Derive prepare_release owner from github.repository_owner in tag_release#19
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-devrepositories. This derives the owner fromgithub.repository_ownerinstead:contains(github.event.head_commit.message, format(' from {0}/prepare_release_v', github.repository_owner))In a reusable workflow the
githubcontext reflects the caller, sogithub.repository_ownerispraw-devfor praw/prawcore and the caller's owner for any outside repo that adopts this workflow.Why it's safe / backward-compatible
github.repository_ownerresolves topraw-dev, so the guard evaluates to the same string as before.Merge pull request #N from OWNER/branchonly contains the repo's own owner when the PR branch lives in the same repo; fork PRs merge asfrom <forkuser>/…and never matchrepository_owner.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_owneris GitHub-provided, not user-controllable input.Follow-up
This is a backward-compatible enhancement → a
v1.4.0tag once merged. Consumers (praw, prawcore) keep working unchanged; outside repos (e.g. CodeSorter) can then callpraw-dev/.github/.github/workflows/tag_release.yml@v1.4.0.🤖 Generated with Claude Code