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
22 changes: 21 additions & 1 deletion .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Release
on:
push:
branches: [main]
workflow_dispatch:

permissions:
contents: write
Expand All @@ -18,7 +19,7 @@ jobs:
release-please:
name: release-please
runs-on: ubuntu-latest
timeout-minutes: 5
timeout-minutes: 8
steps:
- uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5.0.0
id: rp
Expand All @@ -34,3 +35,22 @@ jobs:
gh workflow run -R "${{ github.repository }}" lint.yml --ref "$branch"
gh workflow run -R "${{ github.repository }}" pre-commit.yml --ref "$branch"
done
# Auto-merge fires only once the 4 required checks pass. A merge made
# with GITHUB_TOKEN triggers no push run, so re-dispatch this workflow
# after the merge to let release-please tag the release.
- name: Auto-merge release PRs and cut the release
if: ${{ steps.rp.outputs.prs_created == 'true' }}
env:
GH_TOKEN: ${{ github.token }}
PRS: ${{ steps.rp.outputs.prs }}
run: |
for n in $(jq -r '.[].number' <<<"$PRS"); do
gh pr merge -R "${{ github.repository }}" "$n" --auto --rebase
for _ in $(seq 1 40); do
[ "$(gh pr view -R "${{ github.repository }}" "$n" --json state --jq .state)" = MERGED ] && break
sleep 10
done
[ "$(gh pr view -R "${{ github.repository }}" "$n" --json state --jq .state)" = MERGED ] \
|| { echo "::error::PR $n not merged within 400s"; exit 1; }
done
gh workflow run -R "${{ github.repository }}" release-please.yml --ref main
Loading