From aee6ece6f86edd3b39de9fd4ec7fe7a86a480391 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Jona=C5=A1?= Date: Fri, 24 Mar 2023 20:03:50 +0100 Subject: [PATCH] chore(repo): disable gh workflows for forks (#15887) --- .github/workflows/do-not-merge.yml | 5 +++-- .github/workflows/issue-notifier.yml | 3 ++- .github/workflows/lock-threads.yml | 1 + .github/workflows/publish.yml | 1 + .github/workflows/schedule-stale.yml | 4 ++++ 5 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/do-not-merge.yml b/.github/workflows/do-not-merge.yml index 07aed4e3b5769..ca55ef8599ed1 100644 --- a/.github/workflows/do-not-merge.yml +++ b/.github/workflows/do-not-merge.yml @@ -6,6 +6,7 @@ on: jobs: do-not-merge: + if: ${{ github.repository_owner == 'nrwl' }} name: Prevent Merging runs-on: ubuntu-latest steps: @@ -14,7 +15,7 @@ jobs: echo "${{ toJSON(github.event.*.labels.*.name) }}" node -e 'const forbidden = ["target: next major version", "PR Status: needs tests", "PR Status: in-progress", "blocked: needs rebase"]; const match = ${{ toJSON(github.event.*.labels.*.name) }}.find(l => forbidden.includes(l)); - if (match) { + if (match) { console.log("Cannot merge PRs that are labeled with " + match); - process.exit(1) + process.exit(1) }' diff --git a/.github/workflows/issue-notifier.yml b/.github/workflows/issue-notifier.yml index 01aae7b27e1d4..676a505411bed 100644 --- a/.github/workflows/issue-notifier.yml +++ b/.github/workflows/issue-notifier.yml @@ -11,6 +11,7 @@ permissions: jobs: issues-report: + if: ${{ github.repository_owner == 'nrwl' }} runs-on: ubuntu-latest name: Report status steps: @@ -45,7 +46,7 @@ jobs: - name: Collect Issue Data id: collect run: npx ts-node ./scripts/issues-scraper/index.ts - env: + env: GITHUB_TOKEN: ${{ github.token }} - name: Send GitHub Action trigger data to Slack workflow diff --git a/.github/workflows/lock-threads.yml b/.github/workflows/lock-threads.yml index 140480a2b9f25..770b4cba63f0f 100644 --- a/.github/workflows/lock-threads.yml +++ b/.github/workflows/lock-threads.yml @@ -14,6 +14,7 @@ concurrency: jobs: action: + if: ${{ github.repository_owner == 'nrwl' }} runs-on: ubuntu-latest steps: - uses: dessant/lock-threads@v4 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e049331bd0328..5b1cbc6abdb1e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -193,6 +193,7 @@ jobs: # path: packages/*/*.node # if-no-files-found: error publish: + if: ${{ github.repository_owner == 'nrwl' }} name: Publish runs-on: ubuntu-latest needs: diff --git a/.github/workflows/schedule-stale.yml b/.github/workflows/schedule-stale.yml index af780fbe4d601..8af7f25932e7d 100644 --- a/.github/workflows/schedule-stale.yml +++ b/.github/workflows/schedule-stale.yml @@ -1,10 +1,14 @@ on: schedule: - cron: "0 0 * * *" + name: Stale Bot workflow + permissions: {} + jobs: build: + if: ${{ github.repository_owner == 'nrwl' }} permissions: issues: write # to close stale issues (actions/stale) pull-requests: write # to close stale PRs (actions/stale)