Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions .github/workflows/container-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ name: Container Security Scan
on:
# Allow manual triggering
workflow_dispatch:
inputs:
image_name:
type: string
description: 'Docker image name to scan'
required: false
default: 'supertokens/supertokens-postgresql:latest'

# Run automatically once a day at 2 AM UTC
schedule:
Expand All @@ -19,7 +25,7 @@ jobs:
uses: Azure/container-scan@v0
continue-on-error: true
with:
image-name: supertokens/supertokens-postgresql:latest
image-name: ${{ github.event.inputs.image_name }}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Critical bug: When the workflow runs via the schedule trigger (line 14), github.event.inputs.image_name will be null/empty because scheduled workflows don't have inputs. This will cause the container scan to fail on the daily automated runs.

Fix: Use a fallback to the default image:

image-name: ${{ github.event.inputs.image_name || 'supertokens/supertokens-postgresql:latest' }}

The same issue exists on lines 49 and 85 where the image name is used in output messages.

Spotted by Graphite

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

severity-threshold: LOW
run-quality-checks: false
env:
Expand All @@ -39,7 +45,7 @@ jobs:
run: |
echo "summary<<EOF" >> $GITHUB_OUTPUT

echo "**Image:** \`supertokens/supertokens-postgresql:latest\`\n" >> $GITHUB_OUTPUT
echo "**Image:** \`${{ github.event.inputs.image_name }}\`\n" >> $GITHUB_OUTPUT
echo "**Scan Date:** \`$(date -u)\`\n" >> $GITHUB_OUTPUT
echo "\n" >> $GITHUB_OUTPUT

Expand Down Expand Up @@ -75,7 +81,7 @@ jobs:

- name: Add to Action Summary
run: |
echo "**Image:** \`supertokens/supertokens-postgresql:latest\`" >> $GITHUB_STEP_SUMMARY
echo "**Image:** \`${{ github.event.inputs.image_name }}\`" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Scan Date:** \`$(date -u)\`" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
Expand Down
Loading