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
7 changes: 6 additions & 1 deletion .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ Shared GitHub Actions policy and release workflows, maintained once and pinned b
Copy a caller from [`examples/`](examples/), pin `<pinned-sha>`, 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.

Expand Down
2 changes: 2 additions & 0 deletions examples/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ on:

permissions:
contents: write
pull-requests: write

jobs:
release:
uses: dilettacal/github-workflows/.github/workflows/publish-release.yml@<pinned-sha>
with:
release-version: ${{ inputs.release-version }}
workflows-ref: <pinned-sha>
Loading