diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index bcbcf1d3..21bbe0aa 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -38,6 +38,16 @@ on: - 'true' - 'false' +# Once release-please authors releases with a PAT (#719), a new version fires +# BOTH the tag-push and the release-published triggers (GITHUB_TOKEN used to +# suppress them). They build the same immutable version, so collapse them into a +# single run by grouping on the ref. Branch and PR builds use different refs and +# still run independently; a superseding push cancels an in-flight run for the +# same ref (only the newest build per ref is kept). +concurrency: + group: docker-build-${{ github.ref }} + cancel-in-progress: true + env: REGISTRY: ghcr.io # BACKEND_IMAGE_NAME and FRONTEND_IMAGE_NAME are computed per job in the diff --git a/.github/workflows/release-please-beta.yml b/.github/workflows/release-please-beta.yml index a06f1c93..9fc2d7d8 100644 --- a/.github/workflows/release-please-beta.yml +++ b/.github/workflows/release-please-beta.yml @@ -20,11 +20,40 @@ jobs: uses: googleapis/release-please-action@v4 id: release with: - token: ${{ secrets.GITHUB_TOKEN }} + # A dedicated token (fine-grained PAT) makes the release PR run CI + # automatically (no "workflows awaiting approval") and lets it be + # merged without a manual review. Falls back to GITHUB_TOKEN so the + # workflow still works before the secret is added (#719). + token: ${{ secrets.RELEASE_PLEASE_TOKEN || secrets.GITHUB_TOKEN }} config-file: release-please-config-beta.json manifest-file: .release-please-manifest-beta.json target-branch: main + # Auto-approve + enable auto-merge on the open release PR so betas publish + # with no manual clicks. Approval uses GITHUB_TOKEN (github-actions[bot]) — + # a different identity than the PR author (RELEASE_PLEASE_TOKEN) — so it is + # a valid review (requires the org's "Allow GitHub Actions to approve pull + # requests" + the repo's "Allow auto-merge"). Only meaningful when a PAT is + # set: without it the PR is bot-authored and can't be self-approved, so we + # skip and leave today's manual flow. Best-effort — never blocks the run. + - name: Auto-approve and enable auto-merge on the release PR + if: ${{ steps.release.outputs.release_created != 'true' }} + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + RELEASE_PAT: ${{ secrets.RELEASE_PLEASE_TOKEN }} + run: | + if [ -z "$RELEASE_PAT" ]; then + echo "RELEASE_PLEASE_TOKEN not set — skipping auto-merge (manual review still required)." + exit 0 + fi + pr=$(gh pr list --head release-please--branches--main --state open --json number --jq '.[0].number // empty') + if [ -n "$pr" ]; then + gh pr review "$pr" --approve --body "Automated approval — release-please version bump + changelog (#719)." || true + gh pr merge "$pr" --squash --auto || true + else + echo "No open release PR to auto-merge." + fi + - name: Output Release Info if: ${{ steps.release.outputs.release_created }} run: | diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 60c2dd87..bf31c797 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -20,10 +20,33 @@ jobs: uses: googleapis/release-please-action@v4 id: release with: - token: ${{ secrets.GITHUB_TOKEN }} + # Dedicated token so the release PR runs CI + can auto-merge without a + # manual review. Falls back to GITHUB_TOKEN before the secret is set (#719). + token: ${{ secrets.RELEASE_PLEASE_TOKEN || secrets.GITHUB_TOKEN }} config-file: release-please-config.json manifest-file: .release-please-manifest.json + # Auto-approve + auto-merge the open stable release PR. See the beta + # workflow for the full rationale. Skipped on the release-cutting run and + # whenever no PAT is configured. + - name: Auto-approve and enable auto-merge on the release PR + if: ${{ steps.release.outputs.release_created != 'true' }} + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + RELEASE_PAT: ${{ secrets.RELEASE_PLEASE_TOKEN }} + run: | + if [ -z "$RELEASE_PAT" ]; then + echo "RELEASE_PLEASE_TOKEN not set — skipping auto-merge (manual review still required)." + exit 0 + fi + pr=$(gh pr list --head release-please--branches--stable --state open --json number --jq '.[0].number // empty') + if [ -n "$pr" ]; then + gh pr review "$pr" --approve --body "Automated approval — release-please version bump + changelog (#719)." || true + gh pr merge "$pr" --squash --auto || true + else + echo "No open release PR to auto-merge." + fi + - name: Output Release Info if: ${{ steps.release.outputs.release_created }} run: |