Skip to content

Commit

Permalink
Fix skip jobs that cannot be running on fork
Browse files Browse the repository at this point in the history
  • Loading branch information
nowsprinting committed Nov 18, 2023
1 parent cb3ce5c commit 2adefd8
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/actionlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ jobs:
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: failure() && github.repository_owner == 'nowsprinting' # Skip on public fork, because can not read secrets.
if: failure() && github.event.pull_request.head.repo.fork == false # Skip on public fork, because can not read secrets.
1 change: 1 addition & 0 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ env:

jobs:
build-and-push-docker-image:
if: github.repository_owner == 'nowsprinting' # Skip on forked repo
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/hadolint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ jobs:
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: failure() && github.repository_owner == 'nowsprinting' # Skip on public fork, because can not read secrets.
if: failure() && github.event.pull_request.head.repo.fork == false # Skip on public fork, because can not read secrets.
1 change: 1 addition & 0 deletions .github/workflows/pr-labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:

jobs:
pr-labeler:
if: github.event.pull_request.head.repo.fork == false # Skip on public fork
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ concurrency:

jobs:
release-drafter:
if: github.repository_owner == 'nowsprinting' # Skip on forked repo
runs-on: ubuntu-latest
permissions:
contents: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/shellcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ jobs:
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: failure() && github.repository_owner == 'nowsprinting' # Skip on public fork, because can not read secrets.
if: failure() && github.event.pull_request.head.repo.fork == false # Skip on public fork, because can not read secrets.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ jobs:

notify:
needs: [ test, test-on-container ]
if: failure()
if: failure() && github.event.pull_request.head.repo.fork == false # Skip on public fork, because can not read secrets.
runs-on: ubuntu-latest
permissions:
actions: read
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/update-major.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:

jobs:
update-major:
if: github.repository_owner == 'nowsprinting' # Skip on forked repo
runs-on: ubuntu-latest
permissions:
contents: write
Expand Down

0 comments on commit 2adefd8

Please sign in to comment.