Skip to content

Commit dd2a64d

Browse files
committed
Harden manual SEP lifecycle workflow inputs
1 parent 4df2d6b commit dd2a64d

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

‎.github/workflows/sep-lifecycle-manual.yml‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,20 @@ jobs:
4747
id: automation
4848
working-directory: tools/sep-automation
4949
run: |
50-
if [[ "${{ github.event.inputs.dry_run }}" == "true" ]]; then
50+
if [[ "$DRY_RUN" == "true" ]]; then
5151
echo "::notice::Running in DRY RUN mode - no changes will be made"
5252
else
5353
echo "::warning::Running in PRODUCTION mode - changes will be applied!"
5454
fi
5555
56-
if [[ -n "${{ github.event.inputs.issue_number }}" ]]; then
57-
echo "Processing single issue #${{ github.event.inputs.issue_number }}"
58-
npm start -- --issue ${{ github.event.inputs.issue_number }} 2>&1 | tee automation.log
56+
if [[ -n "$ISSUE_NUMBER" ]]; then
57+
if ! [[ "$ISSUE_NUMBER" =~ ^[1-9][0-9]*$ ]]; then
58+
echo "::error::Issue/PR number must be a positive integer"
59+
exit 1
60+
fi
61+
62+
echo "Processing single issue #$ISSUE_NUMBER"
63+
npm start -- --issue "$ISSUE_NUMBER" 2>&1 | tee automation.log
5964
else
6065
echo "Running full sweep"
6166
npm start 2>&1 | tee automation.log
@@ -68,6 +73,7 @@ jobs:
6873
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6974
MAINTAINERS_TEAM: core-maintainers
7075
DRY_RUN: ${{ github.event.inputs.dry_run }}
76+
ISSUE_NUMBER: ${{ github.event.inputs.issue_number }}
7177
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
7278
LOG_LEVEL: info
7379

0 commit comments

Comments
 (0)