Skip to content

Commit 76e9808

Browse files
committed
ci: add/update workflow for autosquash on PRs
1 parent ca238e5 commit 76e9808

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.github/workflows/tf-autosquash.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737

3838
- name: Determine PR head repo owner
3939
run: |
40-
echo "PR_OWNER=$(gh pr view ${{ github.event.issue.number }} --json headRepositoryOwner -q .headRepositoryOwner.login)" >> $GITHUB_ENV
40+
echo "PR_OWNER=$(gh pr view "${{ github.event.issue.number }}" --json headRepositoryOwner -q .headRepositoryOwner.login)" >> "$GITHUB_ENV"
4141
4242
- name: Verify not a fork PR
4343
# Reason: We want to ensure that the token has write permissions to the repo the PR originated from, also that the user has write permissions to the main repo
@@ -80,16 +80,16 @@ jobs:
8080
run: |
8181
LAST_COMMIT_AUTHOR=$(git log -1 --pretty=format:"%an")
8282
LAST_COMMIT_EMAIL=$(git log -1 --pretty=format:"%ae")
83-
echo "LAST_COMMIT_AUTHOR=$LAST_COMMIT_AUTHOR" >> $GITHUB_ENV
84-
echo "LAST_COMMIT_EMAIL=$LAST_COMMIT_EMAIL" >> $GITHUB_ENV
83+
echo "LAST_COMMIT_AUTHOR=$LAST_COMMIT_AUTHOR" >> "$GITHUB_ENV"
84+
echo "LAST_COMMIT_EMAIL=$LAST_COMMIT_EMAIL" >> "$GITHUB_ENV"
8585
8686
- name: Perform interactive rebase with autosquash
8787
env:
8888
EDITOR: "true" # to automatically complete the interactive rebase
8989
run: |
9090
BASE_REF=$(gh pr view ${{ github.event.issue.number }} --json baseRefName -q .baseRefName)
9191
git fetch origin
92-
git rebase -i --autosquash --empty=drop origin/$BASE_REF
92+
git rebase -i --autosquash --empty=drop "origin/$BASE_REF"
9393
9494
- name: Replace renovate author to prevent renovate overriding changes
9595
env:

0 commit comments

Comments
 (0)