forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixup! build: add create release proposal action
- Loading branch information
Showing
1 changed file
with
14 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,8 +12,6 @@ fi | |
|
||
git config --local user.email "[email protected]" | ||
git config --local user.name "Node.js GitHub Bot" | ||
# git config --local user.email "[email protected]" | ||
# git config --local user.name "RafaelGSS" | ||
|
||
git node release --prepare --skipBranchDiff --yes --releaseDate "$RELEASE_DATE" | ||
# We use it to not specify the branch name as it changes based on | ||
|
@@ -29,4 +27,18 @@ awk "/## ${RELEASE_DATE}/,/^<a id=/{ if (!/^<a id=/) print }" "doc/changelogs/CH | |
|
||
gh pr create --title "$TITLE" --body-file "$TEMP_BODY" --base "v$RELEASE_LINE.x" | ||
|
||
# Dynamically get the repository (owner/repo) and branch | ||
REPO=$(git remote get-url origin | sed -E 's|^.*github.com[/:]([^/]+/[^.]+)(\.git)?$|\1|') | ||
BRANCH=$(git branch --show-current) | ||
|
||
# Get the PR URL for the current branch in the repository | ||
PR_URL=$(gh pr list --repo "$REPO" --head "$BRANCH" --json url -q ".[0].url") | ||
|
||
# Replace "TODO" with the PR URL in the last commit | ||
git commit --amend --no-edit -m "$(git log -1 --pretty=%B | sed "s|PR-URL: TODO|PR-URL: $PR_URL|")" | ||
Check failure on line 38 in tools/actions/create-release.sh GitHub Actions / lint-sh
|
||
|
||
# Force-push the amended commit | ||
git push --force | ||
|
||
rm "$TEMP_BODY" | ||
|