willardmr / sustainable_infrastructure_ci

Continuous integration plugin to enforce sustainability best practices on software infrastructure.
Apache License 2.0
5 stars 2 forks source link

Github reusable workflow #6

Open willardmr opened 1 year ago

willardmr commented 1 year ago

Someone should be able to easily integrate sustainable CI into their github hooks.

AntoineSebert commented 1 year ago

List of github hooks available, with an explanation for the ones that seem not to be relevant:

I suggest we provide the hooks pre-commit / post-commit / post-merge / pre-push by default, with documentation. The other can be derived from them, would they ever be necessary.

Source: https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks

willardmr commented 1 year ago

I may have lead you down the wrong path with the title of this issue.

I might be a bit confused about the terminology, but it looks to me like we just want to provide a github action and give people recommendations for how to use the action with github events. These hooks don't seem super useful to me and I am more used to just adding actions to github workflows. Here is an example of an action I use: superfly/flyctl-actions@1.3 and I just add it to my github workflow as a step. Does that make sense?

AntoineSebert commented 1 year ago

https://docs.github.com/en/actions/using-workflows/reusing-workflows I think this might be what you have in mind ? Essentially we just make a workflow with input and outputs such that other workflows can call it. This might be the first step to have it listed on the marketplace.

willardmr commented 1 year ago

Yeah exactly! I have used those in the past and they work really well. We may want to dockerize our tool since a lot of other workflows seem to do that, but besides that seems like the easiest and most useful thing. What do you think?