ci: Publish only if the workflow is not running on a fork (#574)

* ci: Publish only if the workflow is not running on a fork

Otherwise, the workflow will attempt to publish on forks from contributors that are using the master branch
This commit is contained in:
TwiN 2023-09-23 15:02:33 -04:00 committed by GitHub
parent 05565e3d0a
commit 15c81f93d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -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-to-ghcr:
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

View File

@ -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) }}
timeout-minutes: 60
steps:
- uses: actions/checkout@v3