Skip to content

Commit

Permalink
chore(repo): disable gh workflows for forks (#15887)
Browse files Browse the repository at this point in the history
  • Loading branch information
meeroslav authored Mar 24, 2023
1 parent ac7fbbd commit aee6ece
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 3 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/do-not-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:

jobs:
do-not-merge:
if: ${{ github.repository_owner == 'nrwl' }}
name: Prevent Merging
runs-on: ubuntu-latest
steps:
Expand All @@ -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)
}'
3 changes: 2 additions & 1 deletion .github/workflows/issue-notifier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ permissions:

jobs:
issues-report:
if: ${{ github.repository_owner == 'nrwl' }}
runs-on: ubuntu-latest
name: Report status
steps:
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/lock-threads.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ concurrency:

jobs:
action:
if: ${{ github.repository_owner == 'nrwl' }}
runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@v4
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/schedule-stale.yml
Original file line number Diff line number Diff line change
@@ -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)
Expand Down

0 comments on commit aee6ece

Please sign in to comment.