GithubHelp home page GithubHelp logo

protontypes / continuous-reforestation Goto Github PK

View Code? Open in Web Editor NEW
180.0 7.0 4.0 131 KB

Make continuous reforestation part of your daily workflow :deciduous_tree:

License: MIT License

Dockerfile 13.66% Python 86.34%
reforestation continuous-integration carbon-capture-sequestration carbon-capture sustainable-software sustainability

continuous-reforestation's Introduction

Continuous Reforestation

Make tree planting a part of your daily workflow. ๐ŸŒณ

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. The RaaS API is completely free of charge. You only pay for the trees (1 $ each) directly to the reforestation organization. Find more information on this project read our blog post.

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).
  • the carbon footprint of your digital products after deployment.

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. You also receive the API key value corresponding for your enterprise ID. This is your secret authentication key. Do not add your API key to your workfile yaml file.

  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. If you use GitHub Action for the first time, activate it when prompted.

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

  4. ๐Ÿ—๏ธ Add your authentication key as a secret in your repository Settings -> Secrets -> New Repository Secret: Name: RAASKEY, Value: <your API key>. You can also add it as an organization wide secret in the setting of your organization.

  5. ๐ŸŒฑ Verify the number of trees planted in the dashboard development statistics. Set the production variable to true and push this commit. You now have left the development environment and started planting trees. From now on every configured trigger will continuously request to plant trees. At the end of each month you will be asked to confirm your requested amount of trees.

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

Disclaimer: Even though this workflow automates the request to plant trees, the planting process itself remains manual labour by the reforestation organisations. They are also the people who write your invoice. Due to the amount of work it requires to write these invoices, DigitalHumani accumulates your plant requests until you reach a certain number, depending on your chosen reforestation project, before issuing the order. Below are the least required amounts to receive a monthly invoice and actually plant trees. If you plant more, don't mind this disclaimer.

Reforestation project Necessary number of requested trees
Chase Africa 20
Conserve Natural Forests 20
OneTreePlanted 1
Sustainable Harvest International 50
TIST 20

Example workflows

name: Plant a tree on a successful merged pull request to your main branch
on: 
  pull_request_target:
    branches:
      - main
    types:
      - closed
jobs:
  planttrees:
    runs-on: ubuntu-latest
    steps:
      - name: Plant a Tree
        if: github.event.pull_request.merged == true
        id: planttrees
        uses: protontypes/continuous-reforestation@main
        with:
        # Enter your API variables below
            apikey: ${{ secrets.raaskey }}
            enterpriseid: "<your_enterprise_ID>"
            user: ${{ github.actor }}
            treecount: 1
            projectid: "14442771" # This projectid can be used to have your trees planted where they are needed the most.
            production: "true"

      - name: Response of digitalhumani.com RaaS API
        run: |
            echo "${{ steps.planttrees.outputs.response }}"
name: Plant a tree on every push to main
on:
  push:
    branches:
      - main
jobs:
  planttrees:
    runs-on: ubuntu-latest
    steps:
      - name: Plant a Tree
        id: planttrees
        uses: protontypes/continuous-reforestation@main
        with:
        # Enter your API variables below
            apikey: ${{ secrets.raaskey }}
            enterpriseid: "<your_enterprise_ID"
            user: ${{ github.actor }}
            treecount: 1
            projectid: "14442771" # This projectid can be used to have your trees planted where they are needed the most, so this is a great ID to use by default when making the API call. 
            production: "true"

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

Inputs

Input Description
apikey Your API secret key to the digitalhumani.com RaaS API.
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

cjscheller avatar dwsilk avatar jacobtomlinson avatar ly0n avatar tjarkdoering avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

continuous-reforestation's Issues

Tree Badge for your README

Projects want to show how many trees they have already planted. This could be done with a badge that uses the API.

Metric tracking Successful Tree Plantings

This is a feature request to track the number of successfully planted trees, in addition to the number of trees planted.

Problem

Unfortunately, it's not very helpful to plant 1,000 trees if 999 of them die.

I've worked on afforestation projects planting trees in formerly-deforested, aired climate. Initially planting the tree does require a lot of work, but an equal amount of work is required over the next few years to ensure that the trees actually survive.

Solution

A critical metric for continuous-reforstation is to track the success rate of trees planted.

To start, we should track how many of the trees that were planted died after 1 year. If the afforestation org responsible does not supply this data, it's a red flag and they should not be used.

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.