From 18cf5646b139430e2b9e216f8a0db2ac5f656519 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..0386dee 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..9468c2a 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