Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 2
Message 1 of 2

Stop github actions running on a fork

Solved! Go to Solution.

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

 

1 Reply
Highlighted
Solution
GitHub Partner
Message 2 of 2

Re: Stop github actions running on a fork

@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.

disable_actions.PNG

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.