Skip to content
Closed

DUPE #627

Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ jobs:
- name: Commit and push if changed
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Bind the untrusted PR head ref to an env var so the shell never sees the raw
# ${{ }} expansion. A malicious branch name (e.g. containing $(...) or ;) is then
# treated as literal data by the quoted "$HEAD_REF" below, not executed. (CWE-78)
HEAD_REF: ${{ github.event.pull_request.head.ref }}
run: |
git config --global user.name 'GitHub Action'
git config --global user.email 'action@github.com'
Expand All @@ -38,5 +42,5 @@ jobs:
echo "No changes to commit"
else
git commit -m "Auto-clean notebooks"
git push origin HEAD:${{ github.event.pull_request.head.ref }}
git push origin "HEAD:$HEAD_REF"
fi
Loading