Skip to content

Commit

Permalink
Pass untrusted input via intermediate ENV vars in CI jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
atodorov committed Apr 24, 2023
1 parent 7e9f6df commit e39f7e1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ jobs:
- uses: actions/checkout@v3

- name: check-source-branch-and-modified-files
env:
HEAD_REF: ${{ github.head_ref }}
run: |
echo "INFO: source branch is: ${{ github.head_ref }}"
echo "INFO: source branch is: $HEAD_REF"
# if this PR modifies README.md or setup.py file it needs to come from a branch
# that follows the pattern 'prepare/vX.Y' b/c we want to run some extra jobs for such branches!
if [[ ! "${{ github.head_ref }}" =~ ^prepare/v.+$ ]]; then
if [[ ! "$HEAD_REF" =~ ^prepare/v.+$ ]]; then
echo "FAIL: Modifications to README.md or setup.py are only accepted from 'prepare/vX.Y' branches!"
echo "INFO: Otherwise aarch64 jobs in Circle CI will not be executed."
exit 1
Expand Down

0 comments on commit e39f7e1

Please sign in to comment.