Skip to content

Commit

Permalink
Stop workflows in forks (#2097)
Browse files Browse the repository at this point in the history
Prevent running some workflows/jobs in forks.

---------

Co-authored-by: Martin Costello <martin@martincostello.com>
  • Loading branch information
ceddy4395 and martincostello authored May 13, 2024
1 parent c3c560f commit eb5d8f6
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/after-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

update-changelog:
runs-on: [ ubuntu-latest ]
if: github.event_name == 'release'
if: github.event_name == 'release' && github.event.repository.fork == false

concurrency:
group: '${{ github.workflow }}-changelog'
Expand Down Expand Up @@ -118,6 +118,7 @@ jobs:
update-milestone:
runs-on: [ ubuntu-latest ]
if: github.event.repository.fork == false

concurrency:
group: '${{ github.workflow }}-milestone'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ jobs:
if-no-files-found: ignore

- name: Upload coverage to Codecov
if: always() && github.event.repository.fork == false
uses: codecov/codecov-action@5ecb98a3c6b747ed38dc09f787459979aebb39be # v4.3.1
with:
files: ./artifacts/coverage-reports/Polly.Core.Tests/Cobertura.xml,./artifacts/coverage-reports/Polly.Specs/Cobertura.xml,./artifacts/coverage-reports/Polly.RateLimiting.Tests/Cobertura.xml,./artifacts/coverage-reports/Polly.Extensions.Tests/Cobertura.xml,./artifacts/coverage-reports/Polly.Testing.Tests/Cobertura.xml,
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/on-push-do-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
update-docs:
name: update-docs
runs-on: ubuntu-latest
if: github.event.repository.fork == false

steps:

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ossf-scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
analysis:
name: analysis
runs-on: ubuntu-latest
if: github.event.repository.fork == false

permissions:
id-token: write
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ permissions:
jobs:
stale:
runs-on: ubuntu-latest
if: github.event.repository.fork == false

permissions:
issues: write
pull-requests: write

steps:
- uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e # v9.0.0
with:
Expand Down

0 comments on commit eb5d8f6

Please sign in to comment.