Skip to content

Commit

Permalink
Look for secrets before using them (#2918)
Browse files Browse the repository at this point in the history
Signed-off-by: Josh Soref <[email protected]>
  • Loading branch information
jsoref committed May 31, 2024
1 parent d7d82b6 commit 8e59b6d
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions .github/workflows/artifacts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 8e59b6d

Please sign in to comment.