Skip to content
Merged
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
21 changes: 16 additions & 5 deletions .github/workflows/manual-pre-commit-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,22 @@ jobs:
body: 'Auto-approved pre-commit version update. Merging after checks pass.'
})

# Step 6: Automatically merge the PR
# This is the final step, only executed after all checks pass
# Squash all commits into a single commit on merge
# Step 6: Enable auto-merge on the PR so GitHub merges it once all checks pass
- name: Auto-merge PR
if: steps.check_changes.outputs.only_precommit == 'true'
uses: pascalgn/automerge-action@main
env:
GITHUB_TOKEN: ${{ secrets.BOT_PAT }}
GH_TOKEN: ${{ secrets.BOT_PAT }}
run: |
gh --version
echo "PR: ${{ github.event.pull_request.number }}"
echo "Repo: ${{ github.repository }}"
gh pr view "${{ github.event.pull_request.number }}" \
--repo "${{ github.repository }}" \
--json "number,title,state,mergeable,mergeStateStatus" || {
echo "::error::Failed to view PR — check that BOT_PAT has the required scopes"
exit 1
}
gh pr merge "${{ github.event.pull_request.number }}" \
--squash \
--auto \
--repo "${{ github.repository }}"