fix: name the child repository PR after the tag being released - #42
Merged
Merged
Conversation
- Resolve the template version from the tag when the workflow runs on a tag push, which is the only way it ever runs: the Release workflow creates the release with GITHUB_TOKEN, and GitHub raises no workflow events for that token, so github.event.release was always empty and every pull request was titled "version latest" - Use the resolved version for the title, body, commit message and branch name, keeping the run number for manual runs so their branches do not collide - Build the release notes link from the tag instead of the release payload, so the line is no longer always empty
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.
Overview and Background
Every pull request this workflow has opened in a child repository was titled
Update template to version latest, on a branch named after the run number, with an empty release notes line. Thev2.0.2run producedUpdate template to version latest (resolve conflicts)ontemplate-update-9, so nothing recorded which template version was actually applied.The workflow reads
github.event.release.tag_nameand falls back tolatest. That fallback was meant for manual runs, but it is what always happens: the Release workflow creates the GitHub release withGITHUB_TOKEN, and GitHub does not raise workflow events for actions taken with that token, so thereleasetrigger never fires from this repository's own automation. Only thepushtrigger does, and a tag push carries no release context. The run history confirms it, every run fromv1.1.0throughv2.0.2hasevent=push.Related Issues
None. Third and last defect found in this workflow, after #40 and #41.
Implementation Approach
Resolve template versionstep decides the version once: the release tag when a release event actually fires (a human publishing a release still works), otherwise the tag name fromgithub.ref_namewhen the ref is a tag, otherwiselatest.valuefor display,slugfor the branch name, andrelease_url. The branch keeps using the run number when there is no version, so manual runs cannot collide on atemplate-update-latestbranch.env:rather than direct interpolation, so no expression is expanded into the shell.releasetrigger is kept. It is dead for this repository's automation but still correct if a release is published by hand.Changes
.github/workflows/trigger-template-update.yml: new version resolution step; title, body, commit message and branch use its outputs.Impact
Update template to version v2.0.3on branchtemplate-update-v2.0.3, with a working link to the release notes.latestand a run-number branch.Validation Results
Extracted the step's script with a YAML parser and ran it for each trigger path:
Workflow security lint reports the same findings before and after this change, so nothing new was introduced:
Those two pre-existing findings are untouched here: this workflow's actions are not SHA-pinned and it runs with default permissions, unlike the workflows hardened in #30.