Extend "on" with possibility to ignore forks (run only for the original repo)
See original GitHub issueDescribe the enhancement
Enhancement of the on
directive to tigger a workflow only for the original repo, not a fork of it.
Code Snippet One idea:
on:
push:
repositories:
- 'quarkusio/quarkus'
or more specifically (but less flexible):
on:
push:
ignore-forks: true
or similar.
Additional information
There are a couple of workflows over at https://github.com/quarkusio/quarkus which just don’t make sense to run for forks.
Right now those workflows are using per job:
linux-jvm-tests:
name: JVM Tests - JDK ${{matrix.java.name}}
runs-on: ubuntu-latest
# Skip master in forks
if: "github.repository == 'quarkusio/quarkus'
This is rather verbose and easy to forget for workflows consisting of multiple jobs. Furthermore, it results in many skipped actions entries in forks, e.g. “Cleanup Duplicate CI Runs” here: https://github.com/famod/quarkus/actions
Disabling actions in forks is not an option for Quarkus, since Quarkus contributors are asked to wait for CI in their forks before creating PRs.
PS: Not sure this is the right report for syntax enhancements. 🤔 If not, please point me in the right direction. Thanks!
Issue Analytics
- State:
- Created 3 years ago
- Reactions:22
- Comments:8 (1 by maintainers)
Top GitHub Comments
I would love this feature for our project.
We run many workflows internally via private forks, where the pipeline only gets executed on pull request or on push to master.
We’d love this functionality as well.
As it stands, job-specific conditional for
github.repository
orgithub.repository_owner
will prevent the job itself from running. However, if someone updates their fork from master, the pipeline still executes and then fails to run, which has been annoying the devs since our move to Actions.