Green Action
Check how your project is affecting the planet and check the carbon stats
Read about it in my Dev.to post
Demo
Setup
- Open your README and add paste the following tag in there (this will be
where the image will be placed):
<!-- CARBON-STATS -->
- Add the following workflow to your .github/workflows folder:
name: Website green-o-meter
on:
push:
branches: main
jobs:
update-gist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
persist-credentials: false
fetch-depth: 0
- name: green-website
uses: filiptronicek/green-action@main
env:
URL: https://dev.to #Your measured URL
- name: Commit files
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git commit -m "Update carbon image" -a
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main #Change this
…