Skip to content

Commit 80a4a71

Browse files
zehaclaude
andcommitted
Restrict Docker image pushes to branches from upstream repo
Should avoid the permission denied errors for PRs originating in other repos. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 83683d3 commit 80a4a71

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

.github/workflows/docker.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ jobs:
9797
with:
9898
context: .
9999
file: ./Dockerfile
100-
push: true
100+
push: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
101101
tags: ${{ steps.meta.outputs.tags }}
102102
labels: |
103103
${{ steps.meta.outputs.labels }}
@@ -115,6 +115,7 @@ jobs:
115115
create-manifest:
116116
runs-on: ubuntu-latest
117117
needs: build-and-push
118+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
118119
permissions:
119120
contents: read
120121
packages: write
@@ -161,7 +162,7 @@ jobs:
161162
162163
comment-pr:
163164
runs-on: ubuntu-latest
164-
if: github.event_name == 'pull_request'
165+
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
165166
needs: create-manifest
166167
permissions:
167168
contents: read

0 commit comments

Comments
 (0)