NMF-earth / nmf-app

Understand and reduce your carbon footprint 🌱 iOS & Android.
https://nmf.earth
GNU General Public License v3.0
487 stars 156 forks source link

Reduce CI runs by ignoring pushes to branch and non-functional files #395

Closed ArneTR closed 1 month ago

ArneTR commented 1 month ago

✅ I have read the contributing file

Summary

While submitting a PR for Eco-CI (https://github.com/NMF-earth/nmf-app/pull/393) I noticed that the pipeline was triggering two times everytime I push to the branch of the PR.

To my understanding this was because the on-trigger was set to push and pull_request without limiting it to a specific branch.

I this submit a PR that will trigger on-push runs only on the main branch. This change however follows the idea that every addition to the code is either pushed directly to main or always coming through a feature-branch that will be merged in through a pull-request.

For pushes to pull-requests the trigger will still run, meaning that all pushes to a PR will trigger a new CI run.

Furthermore I added some exclusions that will not trigger runs like for instance markdown files and the .vscode directory.

Feel free to add more directories that are deemed non-functional.

The intention of this PR is to reduce CI runs and this save a bit of energy, Github minutes and potentially CO2.

Hope you like the addition!

Changelog

PierreBresson commented 1 month ago

Legit 👍