Skip to content

Commit

Permalink
Disable workflow on forked repos
Browse files Browse the repository at this point in the history
Currently Devs are receiving github action workflow run email
on each push on their forked repos. It is quite annoying.

Based on https://github.com/orgs/community/discussions/26704,
We can disable the workflow manually or add specific condition to
run workflow on forked repo.

Signed-off-by: Chandan Kumar <[email protected]>
  • Loading branch information
raukadah committed Nov 28, 2024
1 parent 7ec0729 commit 18cf564
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build-watcher-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ env:

jobs:
call-build-workflow:
# Disable workflow on forked repos
if: ${{{{ github.repository == 'openstack-k8s-operators/watcher-operator' }}}}
uses: openstack-k8s-operators/openstack-k8s-operators-ci/.github/workflows/reusable-build-operator.yaml@main
with:
operator_name: watcher
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/noop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ on:
jobs:
# This workflow contains a single job called "build"
build:
# Disable github workflow on forked repo
if: ${{{{ github.repository == 'openstack-k8s-operators/watcher-operator' }}}}
# The type of runner that the job will run on
runs-on: ubuntu-latest

Expand Down

0 comments on commit 18cf564

Please sign in to comment.