Code Monkey home page Code Monkey logo

continuous-reforestation's Introduction

Continuous Reforestation

A GitHub Action for planting trees within your development workflow using the Reforestation as a Service (RaaS) API developed by DigitalHumani. Planting trees is an easy way to make a difference in the fight against climate change. Every tree helps to bind CO2 as long as it grows and creates living space for wildlife. Automating the process gives you total control of where, when and how much you want to contribute while saving you the fuss of doing the whole process manually. By using the RaaS API, you or your project can plant trees in a transparent way by exposing the API calls and related statistics.

Actions Status Actions Status

Use cases

Plant trees on ...

  • pull requests (and/or push, ...).
  • failed or successful tests.
  • the very first contribution to an open source project.
  • a new release, a milestone, or a closed issue.
  • a scheduled event (i.e. once per week).
  • to compensate the carbon footprint when deploying digital product.
  • See more possible trigger events here.

Usage

  1. ๐Ÿ To get started, you need an account with DigitalHumani RaaS. Since they are currently in the early stages, you have to contact them to get an account. Send them an email here.

  2. Copy the example worflow to <your_git_repository>/.github/workflow/integration.yaml and change the variables in the workflow to your data. Set the production variable to false to test your implementation within the sandboxed development API. Push your script to GitHub and check the GitHub Action tab of your project.

  3. ๐Ÿ“ˆ A dashboard is provided to ensure a high level of transparency. This is currently under development and will provide additional details. For this purpose visit: https://digitalhumani.com/dashboard/<enterpriseid>

  4. Verify the number of trees planted in the dashboard development statistics. After a successful run add the API key to the GitHub secrets of your project our organizations as raaskey

To see a list of all supported reforestation projects and more details on the RaaS API read the documentation of DigitalHumani.

Example workflow

name: Integration Example
on:
  push:
    branches:
      - main
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Plant a Tree
        id: planttree
        uses: protontypes/continuous-reforestation@main
        with:
        # Enter your API variables below
            apikey: ${{ secrets.raaskey }}
            enterpriseid: "cd7cedcd"
            user: ${{ github.actor }}
            treecount: 10
            projectid: "92222222" # onetreeplanted.org/collections/latin-america/products/brazil-forests
            production: "true"

      - name: Response of digitalhumani.com RaaS API
        run: |
            echo "${{ steps.planttree.outputs.response }}"

Inputs

Input Description
enterpriseid ID of your enterprise.
user End user by whom the trees were planted. Default is your GitHub user name.
projectid ID of the reforestation project for where you want the trees to be planted.
treeCount Number of trees requested to plant per API call as integer. Every tree will create costs of 1$ per tree
production Set 'true' for the production API or false for the development API

Outputs

Output Description
response JSON response of the RaaS API

continuous-reforestation's People

Contributors

ly0n avatar tjarkdoering avatar jacobtomlinson avatar dwsilk avatar cjscheller avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.