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