diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 6cf5bce..07b40e3 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -13,6 +13,10 @@ on: description: Stable X.Y.Z release version without v. required: true type: string + workflows-ref: + description: The github-workflows SHA this caller pins in `uses:`. Callers must set it. + required: false + type: string outputs: release-url: description: URL of the created or existing GitHub Release. @@ -45,7 +49,8 @@ jobs: uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5 with: repository: dilettacal/github-workflows - ref: ${{ github.workflow_sha }} + # github.workflow_sha is the caller's commit inside workflow_call. + ref: ${{ inputs.workflows-ref || github.workflow_sha }} path: .shared-workflows - name: Capture release date id: date diff --git a/CHANGELOG.md b/CHANGELOG.md index fb19318..8ffba2b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ All notable changes to these reusable GitHub Actions workflows are recorded here ## [Unreleased] +### Fixed + +- Check out release scripts at the caller-pinned `workflows-ref`; `github.workflow_sha` is the caller's commit under `workflow_call`. +- Grant `pull-requests: write` in the release caller example. + ## [0.1.0] - 2026-10-31 ### Added diff --git a/README.md b/README.md index cf88710..3b5e077 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,9 @@ Shared GitHub Actions policy and release workflows, maintained once and pinned b Copy a caller from [`examples/`](examples/), pin ``, and keep the caller responsible for events, permissions, checks, and branch protection. +Release callers pass the same SHA as `workflows-ref`: inside `workflow_call`, +`github.workflow_sha` is the caller's commit, not this repository's. + Release callers dispatch `X.Y.Z`: first run opens a release PR; after merging it, run the same version again to publish the tag and GitHub Release. diff --git a/examples/publish-release.yml b/examples/publish-release.yml index 7844e47..c3624db 100644 --- a/examples/publish-release.yml +++ b/examples/publish-release.yml @@ -10,9 +10,11 @@ on: permissions: contents: write + pull-requests: write jobs: release: uses: dilettacal/github-workflows/.github/workflows/publish-release.yml@ with: release-version: ${{ inputs.release-version }} + workflows-ref: