Skip to content
Merged
Show file tree
Hide file tree
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
13 changes: 10 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,34 @@ name: Release
on:
push:
branches: [main]
# Recovery when GitHub created no run for a release push: replays that push's validation on the given commit.
workflow_dispatch:
inputs:
release-commit:
description: Full SHA of the release commit on main whose push produced no run
type: string
required: true

permissions:
contents: read

concurrency:
group: release-${{ github.sha }}
group: release-${{ inputs.release-commit || github.sha }}
cancel-in-progress: false

jobs:
release-tag:
permissions:
contents: write
uses: BehindTheMusicTree/github-workflows/.github/workflows/release-tag.yml@d2fa2ae24bb974bbb8c97a83a02b2325d4977d33
uses: BehindTheMusicTree/github-workflows/.github/workflows/release-tag.yml@19ffb004a0aba2e96e106c8c956e11b8c5cc0df3
with:
app-id: ${{ vars.RELEASE_APP_ID }}
secrets:
release-app-private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}

release-please:
needs: release-tag
uses: BehindTheMusicTree/github-workflows/.github/workflows/release-please.yml@d2fa2ae24bb974bbb8c97a83a02b2325d4977d33
uses: BehindTheMusicTree/github-workflows/.github/workflows/release-please.yml@19ffb004a0aba2e96e106c8c956e11b8c5cc0df3
with:
app-id: ${{ vars.RELEASE_PR_APP_ID }}
release-policies: .github/release-policy.json
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -739,6 +739,8 @@ The run replays the lost push: it validates the range `parent..commit` with the

GitHub can refuse the tag or the GitHub Release (HTTP 403, `Resource not accessible by integration`) when the release commit's `.github/workflows/` matches no branch tip, because `GITHUB_TOKEN` never holds the `workflows` permission and the release App is not granted it ([reported behaviour](https://github.com/mihazs/lazysh/pull/1196) for `GITHUB_TOKEN`, expected for the App too; not in GitHub's documentation). This happens when a workflow changed on `main` after the release commit. Push a temporary branch at that commit with your own credentials (`git push origin <sha>:refs/heads/recover-release`), dispatch again, then delete the branch.

The dispatch runs the reusable workflows pinned on `main`'s head, so a caller that had not adopted the trigger before the lost push must adopt it first: merge the pin bump with the trigger and the group (a `chore:` PR, whose own push run still fails reconciliation), then dispatch. Adopt it ahead of any outage. Once the recovered tag exists, re-run the failed jobs of the latest push run so release-please reconciles and opens the next release PR.

PyPI publish attestations of a recovered package name the dispatched run's commit (`main`'s head) as their source digest, not the tagged commit: the digest comes from the run's OIDC `sha` claim ([Fulcio](https://github.com/sigstore/fulcio/blob/main/docs/oid-info.md)). The files themselves are built from the tagged commit.

**Deprecated:** `release-github.yml`, and the pattern of a tag-push workflow that calls it, remain only for callers not yet migrated (currently `the-music-tree-pipelines`, `hear-the-music-tree-api` and `python-project-standards`); its pin must equal the tagging pin. New adopters use the [release-please callers](examples/release-please.yml). Removal is planned for a future major version, once those callers have migrated.
Expand Down
Loading