Skip to content

Commit e59ce7a

Browse files
Merge pull request #4475 from rabbitmq/mergify/bp/v3.10.x/pr-4474
Attempt to make the OCI workflow behave reasonably for PRs (backport #4474)
2 parents f84bb56 + e2efd19 commit e59ce7a

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

.github/workflows/oci.yaml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,17 @@ jobs:
103103
restore-keys: |
104104
${{ runner.os }}-${{ matrix.image_tag_suffix }}-buildx-
105105
106+
- name: Check for Push Credentials
107+
id: authorized
108+
run: |
109+
if [ -n "${{ secrets.DOCKERHUB_USERNAME }}" ]; then
110+
echo "::set-output name=PUSH::true"
111+
else
112+
echo "::set-output name=PUSH::false"
113+
fi
114+
106115
- name: Login to DockerHub
116+
if: steps.authorized.outputs.PUSH
107117
uses: docker/login-action@v1
108118
with:
109119
username: ${{ secrets.DOCKERHUB_USERNAME }}
@@ -124,7 +134,7 @@ jobs:
124134
uses: docker/build-push-action@v2
125135
with:
126136
context: packaging/docker-image
127-
push: true
137+
push: ${{ steps.authorized.outputs.PUSH }}
128138
tags: |
129139
pivotalrabbitmq/rabbitmq:${{ steps.compute-tags.outputs.TAG_1 }}
130140
pivotalrabbitmq/rabbitmq:${{ steps.compute-tags.outputs.TAG_2 }}

0 commit comments

Comments
 (0)