Skip to content

Commit 8a6454c

Browse files
Merge pull request #2909 from VWS-Python/env-vars-release
Move release and tag version into env vars to prevent template injection
2 parents 1a332b2 + fa2cb9a commit 8a6454c

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

.github/workflows/release.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,10 @@ jobs:
4949

5050
- name: Get the changelog underline
5151
id: changelog_underline
52+
env:
53+
RELEASE: ${{ steps.calver.outputs.release }}
5254
run: |
53-
underline="$(echo "${{ steps.calver.outputs.release }}" | tr -c '\n' '-')"
55+
underline="$(echo "$RELEASE" | tr -c '\n' '-')"
5456
echo "underline=${underline}" >> "$GITHUB_OUTPUT"
5557
5658
- name: Update changelog
@@ -64,8 +66,10 @@ jobs:
6466
regex: false
6567

6668
- name: Check Update changelog was modified
69+
env:
70+
MODIFIED_FILES: ${{ steps.update_changelog.outputs.modifiedFiles }}
6771
run: |
68-
if [ "${{ steps.update_changelog.outputs.modifiedFiles }}" = "0" ]; then
72+
if [ "$MODIFIED_FILES" = "0" ]; then
6973
echo "Error: No files were modified when updating changelog"
7074
exit 1
7175
fi
@@ -95,9 +99,11 @@ jobs:
9599
body: ${{ steps.tag_version.outputs.changelog }}
96100

97101
- name: Build a binary wheel and a source tarball
102+
env:
103+
NEW_TAG: ${{ steps.tag_version.outputs.new_tag }}
98104
run: |
99105
git fetch --tags
100-
git checkout ${{ steps.tag_version.outputs.new_tag }}
106+
git checkout "$NEW_TAG"
101107
uv build --sdist --wheel --out-dir dist/
102108
uv run --extra=release check-wheel-contents dist/*.whl
103109

zizmor.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,3 @@ rules:
1010
disable: true
1111
superfluous-actions:
1212
disable: true
13-
template-injection:
14-
disable: true

0 commit comments

Comments
 (0)