Skip to content

Commit e044b15

Browse files
committed
Check that the release tag has the expected format
1 parent 46cafbc commit e044b15

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

.github/workflows/update-proxy-release.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ jobs:
2121
env:
2222
RELEASE_TAG: ${{ inputs.tag || 'codeql-bundle-v2.22.0' }}
2323
steps:
24+
- name: Check release tag format
25+
shell: bash
26+
run: |
27+
if ! [[ $RELEASE_TAG =~ ^codeql-bundle-v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
28+
echo "Invalid release tag: expected a CodeQL bundle tag in the 'codeql-bundle-vM.N.P' format."
29+
exit 1
30+
fi
31+
2432
- name: Install Node
2533
uses: actions/setup-node@v4
2634

@@ -40,8 +48,8 @@ jobs:
4048
shell: bash
4149
run: |
4250
NOW=$(date +"%Y%m%d%H%M%S") # only used to make sure we don't fetch stale binaries from the toolcache
43-
sed -i '' "s|https://github.com/github/codeql-action/releases/download/codeql-bundle-v[0-9.]*/|https://github.com/github/codeql-action/releases/download/$RELEASE_TAG/|g" ./src/start-proxy-action.ts
44-
sed -i '' "s/\"v2.0.[0-9]*\"/\"v2.0.$NOW\"/g" ./src/start-proxy-action.ts
51+
sed -i "s|https://github.com/github/codeql-action/releases/download/codeql-bundle-v[0-9.]\+/|https://github.com/github/codeql-action/releases/download/$RELEASE_TAG/|g" ./src/start-proxy-action.ts
52+
sed -i "s/\"v2.0.[0-9]\+\"/\"v2.0.$NOW\"/g" ./src/start-proxy-action.ts
4553
4654
- name: Push changes and open PR
4755
shell: bash

0 commit comments

Comments
 (0)