Skip to content

Commit

Permalink
fixup! build: add create release proposal action
Browse files Browse the repository at this point in the history
  • Loading branch information
RafaelGSS committed Nov 22, 2024
1 parent 02b5d98 commit dfd77b4
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions tools/actions/create-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

View workflow job for this annotation

GitHub Actions / lint-sh

/home/runner/work/node/node/tools/actions/create-release.sh:38:36: Consider invoking this command separately to avoid masking its return value (or use '|| true' to ignore).

Check failure on line 38 in tools/actions/create-release.sh

View workflow job for this annotation

GitHub Actions / lint-sh

/home/runner/work/node/node/tools/actions/create-release.sh:38:61: Consider invoking this command separately to avoid masking its return value (or use '|| true' to ignore).

# Force-push the amended commit
git push --force

rm "$TEMP_BODY"

0 comments on commit dfd77b4

Please sign in to comment.