Skip to content

Commit

Permalink
ci: Publish only if the workflow is not running on a fork
Browse files Browse the repository at this point in the history
Otherwise, the workflow will attempt to publish on forks from contributors that are using the master branch
  • Loading branch information
TwiN authored Sep 23, 2023
1 parent 51798cf commit 5dba511
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/publish-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ on:
branches: [master]
types: [completed]
concurrency:
group: ${{ github.workflow }}
group: ${{ github.event.workflow_run.head_repository.full_name }}::${{ github.event.workflow_run.head_branch }} - ${{ github.workflow }}
cancel-in-progress: true
jobs:
publish-latest:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
if: ${{ (github.event.workflow_run.conclusion == 'success') && (github.event.pull_request.head.repo.full_name == github.repository) }}
permissions:
contents: read
packages: write
Expand Down

0 comments on commit 5dba511

Please sign in to comment.