Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: fix command injection plus other changes #527

Merged
merged 3 commits into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions .changelog/527.internal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CI: fix command injection plus other changes
9 changes: 7 additions & 2 deletions .github/workflows/ci-dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,13 @@ jobs:
run: |
echo "FILE_NAME=.changelog/${{ github.event.pull_request.number }}.internal.md" >> $GITHUB_OUTPUT
- name: Create Change Log file
env:
# There's no support for escaping this for use in a shell command.
# GitHub's recommendation is to pass it through the environment.
# https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
TITLE: ${{ github.event.pull_request.title }}
pro-wh marked this conversation as resolved.
Show resolved Hide resolved
run: |
echo ${{ github.event.pull_request.title }} > ${{ steps.vars.outputs.FILE_NAME }}
echo "$TITLE" > ${{ steps.vars.outputs.FILE_NAME }}
- name: Commit Change Log file
run: |
# Set git user email and name to match author of the last commit.
Expand All @@ -44,4 +49,4 @@ jobs:
git commit --amend --no-edit
- name: Push changes back to branch
run: |
git push --force-with-lease origin HEAD:refs/heads/${{ github.head_ref }}
git push --force-with-lease origin "HEAD:refs/heads/$GITHUB_HEAD_REF"
6 changes: 2 additions & 4 deletions .github/workflows/ci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,8 @@ jobs:
# is able to compare the current branch with the base branch.
# Source: https://github.com/actions/checkout/#fetch-all-branches.
run: |
git fetch --no-tags origin +refs/heads/${BASE_BRANCH}:refs/remotes/origin/${BASE_BRANCH}
towncrier check --compare-with origin/${BASE_BRANCH}
env:
BASE_BRANCH: ${{ github.base_ref }}
git fetch --no-tags origin "+refs/heads/${GITHUB_BASE_REF}:refs/remotes/origin/${GITHUB_BASE_REF}"
towncrier check --compare-with "origin/${GITHUB_BASE_REF}"
if: github.event_name == 'pull_request'
- name: Lint git commits
run: |
Expand Down
Loading