Skip to content

Commit b00b9ae

Browse files
committed
fix: additional shell injection vulnerabilities in version update step
- Add env var for inputs.dry-run - Fix lines 104 and 109 with proper env variable usage - Semgrep findings: yaml.github-actions.security.run-shell-injection Jira: SEC-4316
1 parent 6717827 commit b00b9ae

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

release-poetry-package/action.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ runs:
8383
NEW_RELEASE_VERSION: ${{ steps.version.outputs.new_release_version }}
8484
GIT_USER_NAME: ${{ inputs.git-user-name }}
8585
GIT_USER_EMAIL: ${{ inputs.git-user-email }}
86+
DRY_RUN: ${{ inputs.dry-run }}
8687
run: |
8788
# Use poetry to bump the version in pyproject.toml
8889
poetry version "$NEW_RELEASE_VERSION"
@@ -101,12 +102,12 @@ runs:
101102
# be broken with beta/alpha releases, and might need an explicit check
102103
# somehow to ensure we're not releasing poorly against a branch that
103104
# shouldn't do so
104-
if [[ "${{ inputs.dry-run }}" == "false" ]]; then
105+
if [[ "$DRY_RUN" == "false" ]]; then
105106
git push || { echo "::error:: Failed to push version update for pyproject.toml, check your github-token permissions, or branch protections."; exit 1; }
106107
fi
107108
108109
# Nice logging, generate success exit code from this run step
109-
echo "::notice::Version successfully updated in pyproject.toml to ${{ steps.version.outputs.new_release_version }}."
110+
echo "::notice::Version successfully updated in pyproject.toml to $NEW_RELEASE_VERSION."
110111
- name: Release
111112
id: release
112113
if: steps.version.outputs.new_release_published == 'true'

0 commit comments

Comments
 (0)