File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 9696 mcVersion : 1.12.2
9797 env :
9898 IMAGE_TO_TEST : ${{ github.repository_owner }}/minecraft-server:test-${{ matrix.variant }}-${{ github.run_id }}
99+ HAS_IMAGE_REPO_ACCESS : ${{ secrets.DOCKER_USER != '' && secrets.DOCKER_PASSWORD != '' }}
99100 runs-on : ubuntu-20.04
100101 steps :
101102 - name : Checkout
@@ -152,20 +153,24 @@ jobs:
152153
153154 - name : Login to DockerHub
154155 uses : docker/login-action@v2
156+ if : env.HAS_IMAGE_REPO_ACCESS
155157 with :
156158 username : ${{ secrets.DOCKER_USER }}
157159 password : ${{ secrets.DOCKER_PASSWORD }}
158160
159161 - name : Build and push
160- id : docker_build
161162163+ if : github.actor == github.repository_owner
162164 with :
163165 platforms : ${{ matrix.platforms }}
164166 push : >
165167 ${{
166168 github.ref_type == 'tag'
167169 || github.ref_name == 'master'
168- || ( github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'ci/push-image') )
170+ || ( github.event_name == 'pull_request'
171+ && env.HAS_IMAGE_REPO_ACCESS
172+ && contains(github.event.pull_request.labels.*.name, 'ci/push-image')
173+ )
169174 }}
170175 tags : ${{ steps.meta.outputs.tags }}
171176 # ensure latest base image is used
You can’t perform that action at this time.
0 commit comments