Skip to content

feat(create-pr): Improve the version executed (SHA instead branch) #81

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 21 commits into
base: main
Choose a base branch
from

Conversation

alucardzom
Copy link
Contributor

@alucardzom alucardzom commented Jul 3, 2025

To unify the release method, I’ve tested and dumped the GH action variables at GitHub variable and it’s impossible on a reusable workflow to reuse the SHA used to call it, I’ve tried even testing it, but I can’t.

There is no mention of the Github-tools SHA, the github.action_ref works for a branch name (example) but not for an SHA (example) using it as mentioned in an issue (usage).
There is a few opened cases about this issue at GH pending to be solved:

So in the meantime this is fixed, I would prefer to pass the GitHub-tools-version SHA input until it’s fixed and then this variable could be removed, I prefer to pass a PR changing the SHA instead of letting someone break something at the main branch on Github tools by mistake and promote the change to main, which is currently how it works.

@alucardzom alucardzom force-pushed the ale/release-branch-improvement branch from 7d267f5 to b3aff48 Compare July 4, 2025 13:49
@alucardzom alucardzom marked this pull request as ready for review July 4, 2025 14:31
cursor[bot]

This comment was marked as outdated.

@alucardzom alucardzom changed the title chore: comment line feat(create-pr): Improve the version executed (SHA instead branch) Jul 4, 2025
jluque0101
jluque0101 previously approved these changes Jul 4, 2025
Copy link

@jluque0101 jluque0101 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

jluque0101
jluque0101 previously approved these changes Jul 4, 2025
@Qbandev Qbandev requested a review from Copilot July 4, 2025 15:16
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

The PR refactors how the GitHub Tools version is passed (using SHA via github.action_ref), strengthens commit-generation scripts by ensuring branches exist and are up to date, and streamlines the platform release script’s branch naming and changelog commit logic.

  • Make github-tools-version input optional, defaulting to the caller SHA
  • Fetch and verify local/remote branches in generate-rc-commits.mjs
  • Simplify get_release_branch_name and conditionally add commits.csv in the shell script

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
.github/workflows/create-release-pr.yml Added optional github-tools-version input defaulting to github.action_ref and debug logs
.github/scripts/generate-rc-commits.mjs Inserted git.fetch plus local/remote branch existence checks before commit filtering
.github/scripts/create-platform-release-pr.sh Collapsed release-branch logic, commented old variants, and conditionally stage commits.csv
Comments suppressed due to low confidence (2)

.github/workflows/create-release-pr.yml:52

  • Wrap the expression in quotes (e.g., default: '${{ github.action_ref }}') to ensure the YAML parser treats it as a string rather than attempting to interpolate prematurely.
        default: ${{ github.action_ref }}

.github/scripts/create-platform-release-pr.sh:231

  • This line lacks a leading '+' in the diff and isn’t indented under the if block—ensure it’s only executed when ./commits.csv exists to avoid unintended adds.
    git add ./commits.csv

Qbandev
Qbandev previously approved these changes Jul 4, 2025
Copy link
Contributor

@Qbandev Qbandev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alucardzom LGTM but copilot has in interesting (cosmetic) suggestion.

@Gudahtt
Copy link
Member

Gudahtt commented Jul 11, 2025

Interesting. At first I thought the linked issue had a simple workaround (setting action_ref to an environment variable), but I dug a little further and even that doesn't work correctly for reusable workflows: actions/runner#2473 (comment)

But supposedly setting action_ref as a default value for an input parameter does work 😕 . Strange! But oh well, I guess if this is what works, that's all we can do.

Adding a comment about why the github.action_ref should be added as input.

Co-authored-by: Mark Stacey <markjstacey@gmail.com>
@alucardzom alucardzom dismissed stale reviews from Qbandev and jluque0101 via e2e1b62 July 11, 2025 15:14
We will treat this in a separate PR with a different objective
Copy link
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@@ -254,4 +254,4 @@ else
echo "Changelog PR Created"
fi

echo "Changelog PR Ready"
echo "Changelog PR Ready"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Presumably this was a mistake? Not super important though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants