Stream: helpdesk (published)

Topic: running .github actions before PR


view this post on Zulip Filippos Christou (Jun 19 2023 at 08:46):

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 ?

view this post on Zulip Sascha Mann (Jun 19 2023 at 08:58):

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 pushes 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

view this post on Zulip Sascha Mann (Jun 19 2023 at 08:59):

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.

view this post on Zulip Filippos Christou (Jun 19 2023 at 09:12):

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