Skip to content

Commit 0febee1

Browse files
committed
Do not login or push to dockerhub if secrets not available in job
1 parent 034460d commit 0febee1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

.github/workflows/ci_servicex.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,15 @@ jobs:
105105
uses: docker/setup-buildx-action@v3.10.0
106106
- name: Login to Docker Hub
107107
uses: docker/login-action@v3.3.0
108+
if: ${{ github.secret_source == 'Actions' }}
108109
with:
109110
username: ${{ secrets.DOCKER_USERNAME }}
110111
password: ${{ secrets.DOCKER_PASSWORD }}
111112
- name: Build and push
112113
uses: docker/build-push-action@v6.15.0
113114
with:
114115
context: ${{ matrix.app.dir_name }}
115-
push: true
116+
push: ${{ github.secret_source == 'Actions' }}
116117
tags: ${{ steps.extract_tag_name.outputs.imagetag }}
117118
cache-from: type=${{ format('registry,ref={0}',steps.extract_cache_name.outputs.cachetag) }}
118119
cache-to: type=${{ format('registry,ref={0}',steps.extract_cache_name.outputs.cachetag) }},mode=max

0 commit comments

Comments
 (0)