Fix uninterpolated ${PR_ID} in collections-renames autofix branch name#5157
Merged
Fix uninterpolated ${PR_ID} in collections-renames autofix branch name#5157
Conversation
The `branch:` input to peter-evans/create-pull-request was set to
`update-collections-${PR_ID}`, but Actions inputs aren't shell-
interpolated and no `PR_ID` env var is defined — so the literal
string `${PR_ID}` was ending up in the branch name (e.g.
`update-collections-${PR_ID}`).
peter-evans/create-pull-request is designed to reuse a stable
branch: if an open PR already exists for that branch, it
force-pushes new changes onto it instead of opening a new one.
That's the desired behavior for an hourly autofix job — one
rolling PR, not a new branch each hour.
Drop the suffix entirely.
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes the collections renames autofix workflow to use a stable branch name for peter-evans/create-pull-request, avoiding the literal ${PR_ID} suffix that was never interpolated.
Changes:
- Update
.github/workflows/collections-renames.ymlto setbranch: update-collectionsinstead ofupdate-collections-${PR_ID}.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/collections-renames.yml |
Ensures the autofix workflow uses a stable branch name so subsequent runs update the same PR/branch. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 1/1 changed files
- Comments generated: 0
Contributor
|
Nice, I'd seen this problem but hadn't dug in to fix it - thanks @kenyonj ! |
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
branch:input topeter-evans/create-pull-requestin.github/workflows/collections-renames.ymlwas set toupdate-collections-${PR_ID}, but:PR_IDenv var is defined anywhere in the workflow.So the literal string
${PR_ID}was ending up in the branch name. You can see this on the existing autofix PR — e.g. #5152 reportsforce-pushed the update-collections-${PR_ID} branch.Fix
Drop the suffix.
peter-evans/create-pull-requestis designed around a stable branch: if a PR already exists for that branch, it force-pushes new changes onto it instead of opening a new one. That matches what we want for an hourly autofix job — one rolling open PR, not a new branch every hour.Test plan
update-collectionsand updates the existing autofix PR (or opens one if none is open).${PR_ID}literals in branch names.