From e47cea25b54ce31a932b0beece9a187fe6647b3c Mon Sep 17 00:00:00 2001 From: Bevan Arps Date: Tue, 8 Oct 2024 10:42:15 +1300 Subject: [PATCH] Disable jobs unless running on the main repo (#4324) --- .github/workflows/api-docs-repo.yaml | 6 ++++++ .github/workflows/deploy-site.yml | 5 +++++ .github/workflows/helm-chart-repo.yaml | 3 +++ .github/workflows/visualize-repo.yml | 6 ++++++ 4 files changed, 20 insertions(+) diff --git a/.github/workflows/api-docs-repo.yaml b/.github/workflows/api-docs-repo.yaml index 88b3af70190..6066a3a8222 100644 --- a/.github/workflows/api-docs-repo.yaml +++ b/.github/workflows/api-docs-repo.yaml @@ -10,10 +10,16 @@ on: jobs: gen-crd-docs: + runs-on: ubuntu-latest + permissions: contents: read packages: read + + # Only run this scheduled job on the main repo, it can't work elsewhere + if: ${{ github.repository == 'Azure/azure-service-operator' }} + steps: - name: Create token uses: actions/create-github-app-token@v1 diff --git a/.github/workflows/deploy-site.yml b/.github/workflows/deploy-site.yml index 420643af738..fac338764e8 100644 --- a/.github/workflows/deploy-site.yml +++ b/.github/workflows/deploy-site.yml @@ -8,9 +8,14 @@ on: jobs: deploy-site: + runs-on: ubuntu-latest + permissions: packages: read + + # Only run this scheduled job on the main repo, it can't work elsewhere + if: ${{ github.repository == 'Azure/azure-service-operator' }} steps: - name: Create token diff --git a/.github/workflows/helm-chart-repo.yaml b/.github/workflows/helm-chart-repo.yaml index cbe17385b61..c1c43c8cc53 100644 --- a/.github/workflows/helm-chart-repo.yaml +++ b/.github/workflows/helm-chart-repo.yaml @@ -23,6 +23,9 @@ jobs: contents: read packages: read + # Only run this scheduled job on the main repo, it can't work elsewhere + if: ${{ github.repository == 'Azure/azure-service-operator' }} + steps: - name: Create token uses: actions/create-github-app-token@v1 diff --git a/.github/workflows/visualize-repo.yml b/.github/workflows/visualize-repo.yml index 98d8eb6ffe5..481364da7f7 100644 --- a/.github/workflows/visualize-repo.yml +++ b/.github/workflows/visualize-repo.yml @@ -9,9 +9,15 @@ on: - cron: "35 17 * * 0" jobs: render: + runs-on: ubuntu-latest + permissions: contents: read + + # Only run this scheduled job on the main repo, it can't work elsewhere + if: ${{ github.repository == 'Azure/azure-service-operator' }} + steps: - name: Create token uses: actions/create-github-app-token@v1