Skip to content

Derive prepare_release owner from github.repository_owner in tag_release#19

Merged
bboe merged 1 commit into
mainfrom
generic-tag-release-owner
Jun 13, 2026
Merged

Derive prepare_release owner from github.repository_owner in tag_release#19
bboe merged 1 commit into
mainfrom
generic-tag-release-owner

Conversation

@bboe

@bboe bboe commented Jun 13, 2026

Copy link
Copy Markdown
Member

Summary

The Tag Release guard hardcoded the org in the merge-commit check:

contains(github.event.head_commit.message, ' from praw-dev/prepare_release_v')

so the reusable workflow only ever fired for praw-dev repositories. This derives the owner from github.repository_owner instead:

contains(github.event.head_commit.message, format(' from {0}/prepare_release_v', github.repository_owner))

In a reusable workflow the github context reflects the caller, so github.repository_owner is praw-dev for praw/prawcore and the caller's owner for any outside repo that adopts this workflow.

Why it's safe / backward-compatible

  • Identical for praw-dev repos: github.repository_owner resolves to praw-dev, so the guard evaluates to the same string as before.
  • Fork-injection protection retained: Merge pull request #N from OWNER/branch only contains the repo's own owner when the PR branch lives in the same repo; fork PRs merge as from <forkuser>/… and never match repository_owner.
  • No exposure to callers: reusable workflows run with the caller's GITHUB_TOKEN/secrets, never this repo's, so opening it to external callers grants nothing beyond what copying the public file already would.
  • github.repository_owner is GitHub-provided, not user-controllable input.

Follow-up

This is a backward-compatible enhancement → a v1.4.0 tag once merged. Consumers (praw, prawcore) keep working unchanged; outside repos (e.g. CodeSorter) can then call praw-dev/.github/.github/workflows/tag_release.yml@v1.4.0.

🤖 Generated with Claude Code

The Tag Release guard hardcoded ` from praw-dev/prepare_release_v`, so the
reusable workflow only fired for praw-dev repositories. Deriving the owner
from github.repository_owner (which, in a reusable workflow, reflects the
caller repository) lets repositories outside the org reuse this workflow
while keeping identical behavior for praw-dev repos.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@bboe bboe merged commit 9ff8957 into main Jun 13, 2026
2 checks passed
@bboe bboe deleted the generic-tag-release-owner branch June 13, 2026 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant