You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am looking into how I can build a Github Actions Pipeline for a Monorepo using paths-filters. paths-filters ensures that only the needed Jobs are executed and this works good for PRs / feature branches. As part of the pipeline we run tests on branches and prs. Once a change gets merged into master branch we run a couple of more tests before the changes are deployed to our staging system. This works fine if tests are not failing ;) but in case e.g. some tests fail I would like to somehow with the next run take all changes since the last "successful" commit to master into account.
Technically I can do it by using the commit SHA of the last successful commit as the base. But then I would have to change my workflow yaml once tests finish successfully, which doesnt sound like a good idea.
Any other ideas how to solve this?
Thanks for this great Github Actions ;)
The text was updated successfully, but these errors were encountered:
GitHub provides API to list workflow runs and you can filter them by workflow ID and status. Here are the docs.
Using it to get SHA of last successful run is quite simple. However I would say this is a better fit for a standalone action rather then integrating it directly into paths-filter.
Looks like somebody already made it: last-successful-commit-action.
I didn't test it but the code seems to be doing exactly what you want.
You could then use output of last-successful-commit-action as base input parameter in paths-filter.
Another possible solution would be to maintain a branch or tag pointing to last successful commit. You could have a step in your pipeline which would update it after successful test execution or deployment. paths-filter would then use it as a base instead of master.
I am looking into how I can build a Github Actions Pipeline for a Monorepo using
paths-filters
.paths-filters
ensures that only the needed Jobs are executed and this works good for PRs / feature branches. As part of the pipeline we run tests on branches and prs. Once a change gets merged intomaster
branch we run a couple of more tests before the changes are deployed to our staging system. This works fine if tests are not failing ;) but in case e.g. some tests fail I would like to somehow with the next run take all changes since the last "successful" commit tomaster
into account.Technically I can do it by using the commit SHA of the last successful commit as the
base
. But then I would have to change my workflow yaml once tests finish successfully, which doesnt sound like a good idea.Any other ideas how to solve this?
Thanks for this great Github Actions ;)
The text was updated successfully, but these errors were encountered: