summaryrefslogtreecommitdiff
path: root/.github/workflows
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2022-07-17 06:36:10 -0400
committerNed Batchelder <ned@nedbatchelder.com>2022-07-17 06:36:10 -0400
commit6dff85d81bb77d6212b9fb6a9937729d5012c065 (patch)
treea2a133520110df3841341c1a617db66ea62d29a4 /.github/workflows
parent09be476a63c5aa2c39bdaff4db9b244da2a39a4a (diff)
downloadpython-coveragepy-git-6dff85d81bb77d6212b9fb6a9937729d5012c065.tar.gz
build: avoid a script injection attack
Details here: https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable Found with https://rhysd.github.io/actionlint/
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/coverage.yml4
1 files changed, 3 insertions, 1 deletions
diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml
index 20c0bcc3..622a4c2a 100644
--- a/.github/workflows/coverage.yml
+++ b/.github/workflows/coverage.yml
@@ -185,6 +185,8 @@ jobs:
path: reports_repo/${{ env.report_dir }}
- name: "Push to report repo"
+ env:
+ COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
run: |
set -xe
# Make the redirect to the latest report.
@@ -192,7 +194,7 @@ jobs:
echo "<meta http-equiv='refresh' content='0;url=${{ env.url }}' />" >> reports_repo/latest.html
echo "<body>Coverage report redirect..." >> reports_repo/latest.html
# Make the commit message.
- echo "${{ env.total }}% - ${{ github.event.head_commit.message }}" > commit.txt
+ echo "${{ env.total }}% - $COMMIT_MESSAGE" > commit.txt
echo "" >> commit.txt
echo "${{ env.url }}" >> commit.txt
echo "${{ env.sha10 }}: ${{ env.branch }}" >> commit.txt