Skip to content

Commit d3b27b0

Browse files
committed
fix security issue on workflow
1 parent df3b2a2 commit d3b27b0

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

.github/workflows/tag_release.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,15 @@ jobs:
3636

3737
- name: Resolve release tag
3838
id: resolve_tag
39+
env:
40+
INPUT_TAG: ${{ inputs.tag }}
3941
run: |
40-
if [ -n "${{ inputs.tag }}" ]; then
41-
RELEASE_TAG="${{ inputs.tag }}"
42+
if [ -n "$INPUT_TAG" ]; then
43+
if ! [[ "$INPUT_TAG" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
44+
echo "Invalid tag format: '$INPUT_TAG'. Expected format: X.Y.Z"
45+
exit 1
46+
fi
47+
RELEASE_TAG="$INPUT_TAG"
4248
else
4349
RELEASE_TAG=$(git tag --sort=-version:refname | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$' | head -n 1)
4450
fi
@@ -85,4 +91,4 @@ jobs:
8591
generate_release_notes: true
8692
draft: false
8793
prerelease: false
88-
files: ${{ env.jar_path }}
94+
files: ${{ env.jar_path }}

0 commit comments

Comments
 (0)