Skip to content

Commit 50db22d

Browse files
committed
Fix secret use in step if condition
1 parent 6512b0b commit 50db22d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

.github/workflows/default.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ jobs:
2424
- version: "8.1"
2525
env:
2626
VERSION: ${{ matrix.version }}
27+
DOCKERHUB_ORG: ${{ secrets.DOCKERHUB_ORG }}
28+
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
29+
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
2730

2831
steps:
2932
- name: Checkout
@@ -32,13 +35,13 @@ jobs:
3235
- name: Prepare Tags
3336
id: prep
3437
run: |
35-
DOCKERHUB_IMAGE=${{ secrets.DOCKERHUB_ORG }}/${GITHUB_REPOSITORY#*/}
38+
DOCKERHUB_IMAGE=${DOCKERHUB_ORG}/${GITHUB_REPOSITORY#*/}
3639
GITHUB_IMAGE=${{ github.repository_owner }}/${GITHUB_REPOSITORY#*/}
3740
VERSION=php${{ matrix.version }}
3841
3942
TAGS="ghcr.io/${GITHUB_IMAGE}:${VERSION}"
4043
# Only push to Dockerhub if secrets are set.
41-
if [ ! -z "${{ secrets.DOCKERHUB_ORG }}" ]; then
44+
if [ ! -z "${DOCKERHUB_ORG}" ]; then
4245
TAGS="$TAGS,${DOCKERHUB_IMAGE}:${VERSION}"
4346
fi
4447
@@ -55,7 +58,7 @@ jobs:
5558
uses: docker/setup-buildx-action@v1
5659

5760
- name: Login to DockerHub
58-
if: ${{ github.event_name }} != 'pull_request' && ${{ secrets.DOCKERHUB_ORG }} != ''
61+
if: ${{ github.event_name }} != 'pull_request' && ${{ env.DOCKERHUB_ORG }} != ''
5962
uses: docker/login-action@v1
6063
with:
6164
username: ${{ secrets.DOCKERHUB_USER }}

0 commit comments

Comments
 (0)