Skip to content

Commit 6222159

Browse files
authored
fix: only try to push Docker images when not coming from a fork (#51)
1 parent f74439c commit 6222159

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

.github/workflows/docker-image.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ jobs:
3939
4040
- name: Login to GitHub Container Registry
4141
uses: docker/login-action@v3
42+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
4243
with:
4344
registry: ghcr.io
4445
username: ${{ github.repository_owner }}
@@ -49,7 +50,7 @@ jobs:
4950
with:
5051
context: dev/
5152
file: dev/Dockerfile
52-
push: true
53+
push: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
5354
tags: ${{ steps.meta.outputs.tags }}
5455
labels: ${{ steps.meta.outputs.labels }}
5556

@@ -80,6 +81,7 @@ jobs:
8081
8182
- name: Login to GitHub Container Registry
8283
uses: docker/login-action@v3
84+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
8385
with:
8486
registry: ghcr.io
8587
username: ${{ github.repository_owner }}
@@ -91,7 +93,7 @@ jobs:
9193
context: builder/
9294
file: builder/Dockerfile
9395
platforms: linux/amd64,linux/arm64
94-
push: true
96+
push: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
9597
tags: ${{ steps.meta.outputs.tags }}
9698
labels: ${{ steps.meta.outputs.labels }}
9799

@@ -119,6 +121,7 @@ jobs:
119121
120122
- name: Login to GitHub Container Registry
121123
uses: docker/login-action@v3
124+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
122125
with:
123126
registry: ghcr.io
124127
username: ${{ github.repository_owner }}
@@ -129,6 +132,6 @@ jobs:
129132
with:
130133
context: wasi/
131134
file: wasi/Dockerfile
132-
push: true
135+
push: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
133136
tags: ${{ steps.meta.outputs.tags }}
134137
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)