[ACS-10124] Fix Change this action to not use user-controlled data directly in a run block sonar issue (#4810)

* [ACS-10124] Fix Change this action to not use user-controlled data directly in a run block sonar issue

* [ACS-10124] Corrected typo
This commit is contained in:
AleksanderSklorz
2025-09-25 10:50:08 +02:00
committed by GitHub
parent 0407c236c4
commit 296789da22
5 changed files with 21 additions and 9 deletions
@@ -14,10 +14,12 @@ runs:
steps:
- name: Update Versions
shell: bash
env:
BRANCH_NAME: ${{ inputs.branch_name }}
run: |
VERSION_IN_PACKAGE_JSON=$(jq -cr '.version' < package.json)
if [[ ${{ inputs.branch_name }} =~ ^master.*?$ ]] || [[ "${{ inputs.branch_name }}" == release/* ]] ; then
if [[ $BRANCH_NAME =~ ^master.*?$ ]] || [[ "$BRANCH_NAME" == release/* ]] ; then
NEW_LIBRARY_VERSION="$VERSION_IN_PACKAGE_JSON"
else
NEW_LIBRARY_VERSION="${VERSION_IN_PACKAGE_JSON}-${{ github.run_id }}"