ci: fix target branch name usage
@@ -48,7 +48,10 @@ jobs:
name: Run pre-commit
if: github.event.action != 'closed' && github.event.pull_request.merged != true
run: |
- pre-commit run --from-ref ${{ github.event.pull_request.base.sha }} --to-ref ${{ github.event.pull_request.head.sha }} --show-diff-on-failure --color=always
+ pre-commit run --from-ref "${FROM_REF}" --to-ref "${TO_REF}" --show-diff-on-failure --color=always
+ env:
+ FROM_REF: ${{ github.event.pull_request.base.sha }}
+ TO_REF: ${{ github.event.pull_request.head.sha }}
- name: Commit changes
if: ${{ failure() }}
run: |-
@@ -56,8 +59,10 @@ jobs:
git config user.name "${GIT_AUTHOR_NAME}"
git config user.email "${GIT_AUTHOR_EMAIL}"
git commit -m "pre-commit fixes"
- git push origin HEAD:${{ github.event.pull_request.head.ref }}
+ git push origin "HEAD:${HEAD_REF}"
exit 1
+ env:
+ HEAD_REF: ${{ github.event.pull_request.head.ref }}
test:
strategy:
