Skip to content

Commit

Permalink
Merge pull request #39 from nowsprinting/chore/fix_workflows_for_publ…
Browse files Browse the repository at this point in the history
…ic_fork

Fix skip jobs that cannot be running on fork
  • Loading branch information
nowsprinting authored Nov 18, 2023
2 parents cb3ce5c + 2adefd8 commit c71be3b
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 c71be3b

Please sign in to comment.