Skip to content

Commit

Permalink
fixup! forks do not have permissions to push images
Browse files Browse the repository at this point in the history
  • Loading branch information
eguzki committed Apr 30, 2024
1 parent 4c95ad8 commit 8630bfc
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions .github/workflows/build-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ env:
jobs:
build:
name: Build
if: github.event.pull_request.head.repo.full_name == github.repository
# for tags and not forks
if: |
(startsWith(github.ref, 'refs/tags/')) ||
(!startsWith(github.ref, 'refs/tags/') &&
github.event.pull_request.head.repo.full_name == github.repository)
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down Expand Up @@ -73,7 +77,11 @@ jobs:
retention-days: 1
merge:
runs-on: ubuntu-latest
if: github.event.pull_request.head.repo.full_name == github.repository
# for tags and not forks
if: |
(startsWith(github.ref, 'refs/tags/')) ||
(!startsWith(github.ref, 'refs/tags/') &&
github.event.pull_request.head.repo.full_name == github.repository)
needs:
- build
steps:
Expand Down Expand Up @@ -115,8 +123,10 @@ jobs:
run: |
docker run --rm -t ${{ env.IMG_REGISTRY_HOST }}/${{ env.IMG_REGISTRY_ORG }}/limitador:${{ steps.meta.outputs.version }} limitador-server --help
build-from-forks:
name: Build
if: github.event.pull_request.head.repo.full_name != github.repository
name: Build on forks
if: |
!startsWith(github.ref, 'refs/tags/') &&
github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
steps:
- name: Check out code
Expand Down

0 comments on commit 8630bfc

Please sign in to comment.