Skip to content

Commit 4bf5a2c

Browse files
committed
Verify analysis-name for security
1 parent f3d6955 commit 4bf5a2c

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
@@ -120,6 +120,12 @@ jobs:
120120
- name: Assure that either artifacts-upload-name or maven-artifacts or sources-upload-name or source-repository is set
121121
if: inputs.artifacts-upload-name == '' && inputs.maven-artifacts == '' && inputs.sources-upload-name == '' && inputs.source-repository == ''
122122
run: echo "Please specify either the input parameter 'artifacts-upload-name' or 'maven-artifacts' or 'sources-upload-name' or 'source-repository'."; exit 1
123+
- name: Verify analysis-name only consists of characters safe for folder names
124+
run: |
125+
if [[ ! "${{ inputs.analysis-name }}" =~ ^[A-Za-z0-9._-]+$ ]]; then
126+
echo "The analysis-name '${{ inputs.analysis-name }}' contains invalid characters. Only alphanumeric characters, dots (.), underscores (_) and hyphens (-) are allowed."
127+
exit 1
128+
fi
123129
124130
- name: Assemble ENVIRONMENT_INFO
125131
run: echo "ENVIRONMENT_INFO=java-${{ matrix.java }}-python-${{ matrix.python }}-miniforge-${{ matrix.miniforge }}" >> $GITHUB_ENV

0 commit comments

Comments
 (0)