Skip to content

Commit b6fcab5

Browse files
authored
ci: always login to Docker if not a Pull Request (#1599)
1 parent 1e49586 commit b6fcab5

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

.github/workflows/docker.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ jobs:
134134
platforms: ${{ matrix.platform }}
135135
- name: Login to DockerHub
136136
uses: docker/login-action@v3
137-
if: github.event.pull_request.head.repo.full_name == github.repository
137+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
138138
with:
139139
username: ${{ secrets.REGISTRY_USERNAME }}
140140
password: ${{ secrets.REGISTRY_PASSWORD }}
@@ -223,7 +223,7 @@ jobs:
223223
uses: docker/setup-buildx-action@v3
224224
- name: Login to DockerHub
225225
uses: docker/login-action@v3
226-
if: github.event.pull_request.head.repo.full_name == github.repository
226+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
227227
with:
228228
username: ${{ secrets.REGISTRY_USERNAME }}
229229
password: ${{ secrets.REGISTRY_PASSWORD }}

.github/workflows/static.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ jobs:
101101
platforms: ${{ matrix.platform }}
102102
- name: Login to DockerHub
103103
uses: docker/login-action@v3
104-
if: github.event.pull_request.head.repo.full_name == github.repository
104+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
105105
with:
106106
username: ${{ secrets.REGISTRY_USERNAME }}
107107
password: ${{ secrets.REGISTRY_PASSWORD }}
@@ -205,7 +205,7 @@ jobs:
205205
platforms: ${{ matrix.platform }}
206206
- name: Login to DockerHub
207207
uses: docker/login-action@v3
208-
if: github.event.pull_request.head.repo.full_name == github.repository
208+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
209209
with:
210210
username: ${{ secrets.REGISTRY_USERNAME }}
211211
password: ${{ secrets.REGISTRY_PASSWORD }}
@@ -315,7 +315,7 @@ jobs:
315315
uses: docker/setup-buildx-action@v3
316316
- name: Login to DockerHub
317317
uses: docker/login-action@v3
318-
if: github.event.pull_request.head.repo.full_name == github.repository
318+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
319319
with:
320320
username: ${{ secrets.REGISTRY_USERNAME }}
321321
password: ${{ secrets.REGISTRY_PASSWORD }}

0 commit comments

Comments
 (0)