Do you know if I can run the .github actions of a repo locally before pushing on the remote ?
There are some several discussions online, but how are you people doing it ?
At the very least I would expect that .github actions would be triggered in the forked repo, but apparently some configurations are needed there as well, which they are not clear to me right now.
If you have experience with that, how are your setup/configurations ?
You can try https://github.com/nektos/act to run them locally.
If you go to the actions tab in a forked repo, you should see an option to enable them if they aren't. The required config varies depending on the workflow. E.g. some may require secrets or URLs to be changed to your dev env. For basic things like running tests, you may have to change the trigger if it only runs on pull_request
but you want to run it on push
es as well on your fork (keeping in mind they run tests on different commits) so that you don't have to open a PR on your fork first
That said, I generally don't run them locally. I might run the same tests that are run by the actions manually but I don't try to run the exact workflow.
you may have to change the trigger
I think that was what I was missing. That's a bit inconvenient because then I will have to rechange it before doing the PR. Making a PR to the forked master doesn't sound so bad actually and it should be enough to replicate the actions..
Last updated: Dec 28 2024 at 04:38 UTC