-
Notifications
You must be signed in to change notification settings - Fork 14.3k
feat(patch): improve visibility of patch process #9774
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -7,6 +7,7 @@ | |||||||||
| */ | ||||||||||
|
|
||||||||||
| import { execSync } from 'node:child_process'; | ||||||||||
| import { appendFileSync } from 'node:fs'; | ||||||||||
| import yargs from 'yargs'; | ||||||||||
| import { hideBin } from 'yargs/helpers'; | ||||||||||
|
|
||||||||||
|
|
@@ -44,9 +45,16 @@ async function main() { | |||||||||
|
|
||||||||||
| const releaseInfo = getLatestReleaseInfo(channel); | ||||||||||
| const latestTag = releaseInfo.currentTag; | ||||||||||
| const nextVersion = releaseInfo.nextVersion; | ||||||||||
|
|
||||||||||
| // Expose versions for subsequent steps | ||||||||||
| if (process.env.GITHUB_OUTPUT) { | ||||||||||
| appendFileSync(process.env.GITHUB_OUTPUT, `base_version=${latestTag}\n`); | ||||||||||
| appendFileSync(process.env.GITHUB_OUTPUT, `new_version=${nextVersion}\n`); | ||||||||||
|
Comment on lines
+52
to
+53
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is a potential command injection vulnerability here. The For example, if This would set an unexpected output According to GitHub Actions documentation, multiline strings are not supported for outputs written to
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mattKorwel Could you advise if this is actually a threat? IIUC these scripts run within Github's action runner? |
||||||||||
| } | ||||||||||
|
|
||||||||||
| const releaseBranch = `release/${latestTag}`; | ||||||||||
| const hotfixBranch = `hotfix/${latestTag}/${channel}/cherry-pick-${commit.substring(0, 7)}`; | ||||||||||
| const hotfixBranch = `hotfix/${latestTag}/${nextVersion}/${channel}/cherry-pick-${commit.substring(0, 7)}`; | ||||||||||
|
|
||||||||||
| // Create the release branch from the tag if it doesn't exist. | ||||||||||
| if (!branchExists(releaseBranch)) { | ||||||||||
|
|
@@ -184,11 +192,14 @@ async function main() { | |||||||||
| console.log( | ||||||||||
| `Creating pull request from ${hotfixBranch} to ${releaseBranch}...`, | ||||||||||
| ); | ||||||||||
| let prTitle = `fix(patch): cherry-pick ${commit.substring(0, 7)} to ${releaseBranch}`; | ||||||||||
| let prBody = `This PR automatically cherry-picks commit ${commit} to patch the ${channel} release.`; | ||||||||||
| let prTitle = `fix(patch): cherry-pick ${commit.substring(0, 7)} to ${nextVersion} (from ${latestTag})`; | ||||||||||
| let prBody = `This PR automatically cherry-picks commit \`${commit.substring( | ||||||||||
| 0, | ||||||||||
| 7, | ||||||||||
| )}\` to create patch release **${nextVersion}** for the \`${channel}\` release channel, based on version \`${latestTag}\`.`; | ||||||||||
|
|
||||||||||
| if (hasConflicts) { | ||||||||||
| prTitle = `fix(patch): cherry-pick ${commit.substring(0, 7)} to ${releaseBranch} [CONFLICTS]`; | ||||||||||
| prTitle = `fix(patch): cherry-pick ${commit.substring(0, 7)} to ${nextVersion} (from ${latestTag}) [CONFLICTS]`; | ||||||||||
| prBody += ` | ||||||||||
|
|
||||||||||
| ## ⚠️ Merge Conflicts Detected | ||||||||||
|
|
||||||||||
Uh oh!
There was an error while loading. Please reload this page.