Stop github actions running on a fork

Hey everyone,

I have a fork of danielkrupinski\Osiris on my Github, here and recently Daniel pushed a pull request which added a new action for testing the building of Osiris. Personally, I don’t want to have these actions running on my Fork, is there an easy way to freeze actions so as to stop my fork using up my Action time… By the way, I expect the main.yml to updated quite frequently on his master branch soon as the pull request mentions adding things such as artifacting + automatic release uploading! If I just delete main.yml the pull request, which is currrently automatic, will always conflict!

Also, is it possible to have my own github action, instead of his, because with my releases, I build for AVX, AVX2, IA32 & SSE2, and I have a main.yml and obviously this would conflict with my automatic pull system, as it did when I first had these github actions and having this main.yml would make it so I would have to go through the round-about route of allowing his main.yml to update (i.e. delete my main.yml, pushing his pull request, adding my custom main.yml back), feel free to point me in the right direction, if I am wrong here though!

Thanks in advance,

Jim

@jimbob88 ,

If you do not want any workflows run on your repository, you can navigate to Settings > Actions > Actions permissions to Disable Actions for this repository.

However, as you mentioned, you may need to run some of yourself workflows, so this may be not a perfect way. And we have no methods to allow us to tell the PRs only merge the files we want and do not merge the files we do not want.

As a workaround, maybe you can try this:

  1. Keep all the workflow YAML files in your forked repository, include yours and other people’s.

  2. In your workflows, add the following if conditional for each job.

    if: github.repository == ‘jimbob88/Osiris’

  3. In other workflows, add the following if conditional for each job.

    if: github.repository != ‘jimbob88/Osiris’

The property github.repository of the github context can return name of the repository where the workflow is running. Of course, you also need to merge and sync the same configurations to the original repository.

This is the only way I can think of, hope it can help you.

4 Likes

This worked for my use case, where I only forked a repo to make a PR against the upstream repo. I have no interest in running the scheduled junk they run upstream.

But it seems like having it disabled really ought to be the default. It’s that way for other systems, like Travis. I know the permissions model is different there, but still, it shows folks are fine with having to check a box before their CI config runs.

2 Likes