Skip to content

Commit 2dfe99f

Browse files
committed
Verify analysis-name for security
1 parent c0de13e commit 2dfe99f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

.github/workflows/public-analyze-code-graph.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,12 @@ jobs:
9090
- name: Assure that either artifacts-upload-name or sources-upload-name is set
9191
if: inputs.artifacts-upload-name == '' && inputs.sources-upload-name == ''
9292
run: echo "Please specify either the input parameter 'artifacts-upload-name' or 'sources-upload-name'."; exit 1
93+
- name: Verify analysis-name only consists of characters safe for folder names
94+
run: |
95+
if [[ ! "${{ inputs.analysis-name }}" =~ ^[A-Za-z0-9._-]+$ ]]; then
96+
echo "The analysis-name '${{ inputs.analysis-name }}' contains invalid characters. Only alphanumeric characters, dots (.), underscores (_) and hyphens (-) are allowed."
97+
exit 1
98+
fi
9399
94100
- name: Assemble ENVIRONMENT_INFO
95101
run: echo "ENVIRONMENT_INFO=java-${{ matrix.java }}-python-${{ matrix.python }}-miniforge-${{ matrix.miniforge }}" >> $GITHUB_ENV

0 commit comments

Comments
 (0)