Skip to content
Merged
Changes from all commits
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
15 changes: 15 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ runs:
env:
SWAMP_API_KEY: ${{ inputs.api-key }}
run: |
# Reject values containing newlines to prevent GITHUB_ENV injection
if [[ "$SWAMP_API_KEY" == *$'\n'* ]]; then
echo "::error::api-key must not contain newlines"
exit 1
fi
echo "::add-mask::${SWAMP_API_KEY}"
echo "SWAMP_API_KEY=${SWAMP_API_KEY}" >> "$GITHUB_ENV"

Expand All @@ -65,6 +70,16 @@ runs:
env:
SWAMP_CLUB_URL: ${{ inputs.swamp-club-url }}
run: |
# Reject values containing newlines to prevent GITHUB_ENV injection
if [[ "$SWAMP_CLUB_URL" == *$'\n'* ]]; then
echo "::error::swamp-club-url must not contain newlines"
exit 1
fi
# Validate URL scheme
if [[ "$SWAMP_CLUB_URL" != https://* ]]; then
echo "::error::swamp-club-url must use https://"
exit 1
fi
echo "SWAMP_CLUB_URL=${SWAMP_CLUB_URL}" >> "$GITHUB_ENV"

- name: Verify authentication
Expand Down
Loading