From 369a1f9046d4779e4fe34f7553adc577c9343213 Mon Sep 17 00:00:00 2001 From: Chandan Kumar Date: Thu, 28 Nov 2024 20:14:09 +0530 Subject: [PATCH] Disable workflow on forked repos 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 --- .github/workflows/build-watcher-operator.yaml | 2 ++ .github/workflows/noop.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/build-watcher-operator.yaml b/.github/workflows/build-watcher-operator.yaml index f7f3fb6..44d3c18 100644 --- a/.github/workflows/build-watcher-operator.yaml +++ b/.github/workflows/build-watcher-operator.yaml @@ -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 diff --git a/.github/workflows/noop.yml b/.github/workflows/noop.yml index 01502b1..986e14c 100644 --- a/.github/workflows/noop.yml +++ b/.github/workflows/noop.yml @@ -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