From 48e3851f520bfc08f0a099f15251ab282e623ca2 Mon Sep 17 00:00:00 2001 From: Stefano Guerrini Date: Wed, 14 Oct 2026 12:42:29 +0200 Subject: [PATCH] ci(release): run CI on release PRs Release PRs come from GITHUB_TOKEN, so GitHub starts no workflows on them. The release workflow now starts CI on each open release PR, so its checks run before the merge. --- .github/workflows/ci.yml | 2 ++ .github/workflows/release.yml | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aad202c..63ce3a3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,8 @@ name: CI on: + # The release workflow starts CI on release PRs, which start no workflows themselves. + workflow_dispatch: push: branches: [main] pull_request: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ace932c..d4ac75c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,6 +22,7 @@ jobs: group: ${{ github.workflow }}-release-pr cancel-in-progress: false permissions: + actions: write contents: write pull-requests: write steps: @@ -32,6 +33,20 @@ jobs: manifest-file: .release-please-manifest.json skip-github-release: true + # A PR that GITHUB_TOKEN opens starts no workflows, so start CI on each + # open release PR here. Its results show on the release PR. + - name: Run CI on the release PR + env: + GH_TOKEN: ${{ github.token }} + run: | + set -euo pipefail + gh pr list --repo "$GITHUB_REPOSITORY" --state open --author app/github-actions \ + --label "autorelease: pending" --json headRefName --jq '.[].headRefName' | + while read -r branch; do + echo "Starting CI on $branch" + gh workflow run ci.yml --repo "$GITHUB_REPOSITORY" --ref "$branch" + done + detect: name: Detect a release runs-on: ubuntu-latest