Look for secrets before using them (#2918)

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
This commit is contained in:
Josh Soref
2024-05-31 17:44:57 +02:00
committed by GitHub
parent d7d82b6377
commit 8e59b6d3b3
+18 -2
View File
@@ -28,10 +28,26 @@ permissions:
contents: read
jobs:
container-image:
name: Container image
config:
runs-on: ubuntu-latest
steps:
- name: Check Secrets
id: check-secrets
env:
username: ${{ secrets.DOCKER_USERNAME || '' }}
password: ${{ secrets.DOCKER_PASSWORD || '' }}
if: ${{ env.username != '' && env.password != '' }}
shell: bash
run:
echo has-secrets=1 >> "$GITHUB_OUTPUT"
outputs:
has-secrets: ${{ steps.check-secrets.outputs.has-secrets }}
container-images:
name: Container images
runs-on: ubuntu-latest
needs: config
if: ${{ needs.config.outputs.has-secrets }}
strategy:
matrix:
variant: