chore(repo): disable gh workflows for forks (#15887)

This commit is contained in:
Miroslav Jonaš 2023-03-24 20:03:50 +01:00 committed by GitHub
parent ac7fbbd121
commit aee6ece6f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 3 deletions

View File

@ -6,6 +6,7 @@ on:
jobs: jobs:
do-not-merge: do-not-merge:
if: ${{ github.repository_owner == 'nrwl' }}
name: Prevent Merging name: Prevent Merging
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@ -14,7 +15,7 @@ jobs:
echo "${{ toJSON(github.event.*.labels.*.name) }}" 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"]; 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)); 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); console.log("Cannot merge PRs that are labeled with " + match);
process.exit(1) process.exit(1)
}' }'

View File

@ -11,6 +11,7 @@ permissions:
jobs: jobs:
issues-report: issues-report:
if: ${{ github.repository_owner == 'nrwl' }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: Report status name: Report status
steps: steps:
@ -45,7 +46,7 @@ jobs:
- name: Collect Issue Data - name: Collect Issue Data
id: collect id: collect
run: npx ts-node ./scripts/issues-scraper/index.ts run: npx ts-node ./scripts/issues-scraper/index.ts
env: env:
GITHUB_TOKEN: ${{ github.token }} GITHUB_TOKEN: ${{ github.token }}
- name: Send GitHub Action trigger data to Slack workflow - name: Send GitHub Action trigger data to Slack workflow

View File

@ -14,6 +14,7 @@ concurrency:
jobs: jobs:
action: action:
if: ${{ github.repository_owner == 'nrwl' }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: dessant/lock-threads@v4 - uses: dessant/lock-threads@v4

View File

@ -193,6 +193,7 @@ jobs:
# path: packages/*/*.node # path: packages/*/*.node
# if-no-files-found: error # if-no-files-found: error
publish: publish:
if: ${{ github.repository_owner == 'nrwl' }}
name: Publish name: Publish
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: needs:

View File

@ -1,10 +1,14 @@
on: on:
schedule: schedule:
- cron: "0 0 * * *" - cron: "0 0 * * *"
name: Stale Bot workflow name: Stale Bot workflow
permissions: {} permissions: {}
jobs: jobs:
build: build:
if: ${{ github.repository_owner == 'nrwl' }}
permissions: permissions:
issues: write # to close stale issues (actions/stale) issues: write # to close stale issues (actions/stale)
pull-requests: write # to close stale PRs (actions/stale) pull-requests: write # to close stale PRs (actions/stale)