Skip to content
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

build: add create release proposal action #55690

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

Conversation

RafaelGSS
Copy link
Member

Blocked until the following PR lands

Refs: nodejs/security-wg#860


The purpose is to have an action that will generate the release proposal (assuming the vN.x-staging is up to date). After that, I'll create a second action the keep the staging branches up-to-date.

cc: @nodejs/releasers

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/actions

@nodejs-github-bot nodejs-github-bot added meta Issues and PRs related to the general management of the project. tools Issues and PRs related to the tools directory. labels Nov 2, 2024
@RafaelGSS RafaelGSS added the blocked PRs that are blocked by other issues or PRs. label Nov 2, 2024
Comment on lines +31 to +34
env:
STAGING_BRANCH: v${{ inputs.release-line }}.x-staging
RELEASE_BRANCH: v${{ inputs.release-line }}.x
RELEASE_DATE: ${{ inputs.release-date }}
Copy link
Member

Choose a reason for hiding this comment

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

Can't you merge this with the env a few lines above?

# Needs the whole git history for ncu to work
# See https://github.com/nodejs/node-core-utils/pull/486
fetch-depth: 0
token: ${{ secrets.GH_USER_TOKEN }}
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't need the special token, it's only checking out a branch?

- name: Set variables
run: |
echo "REPOSITORY=$(echo ${{ github.repository }} | cut -d/ -f2)" >> $GITHUB_ENV
echo "OWNER=${{ github.repository_owner }}" >> $GITHUB_ENV
Copy link
Member

Choose a reason for hiding this comment

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

Why not set this when the rest of the environment is set?


- name: Set variables
run: |
echo "REPOSITORY=$(echo ${{ github.repository }} | cut -d/ -f2)" >> $GITHUB_ENV
Copy link
Member

Choose a reason for hiding this comment

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

You should probably store "github.repository" in an environment variable, IMO it's cleaner + it's best practice


- name: Configure @node-core/utils
run: |
ncu-config set branch ${{ env.RELEASE_BRANCH }}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
ncu-config set branch ${{ env.RELEASE_BRANCH }}
ncu-config set branch "${RELEASE_BRANCH}"

JENKINS_TOKEN: ${{ secrets.JENKINS_TOKEN }}

- name: Start git node release prepare
run: ./tools/actions/create-release.sh ${{ inputs.RELEASE_DATE }}
Copy link
Member

Choose a reason for hiding this comment

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

storing the input in an environment variable is best practice

# We use it to not specify the branch name as it changes based on
# the commit list (semver-minor/semver-patch)
git config push.default current
git push upstream
Copy link
Contributor

Choose a reason for hiding this comment

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

We probably should not expect to have push permission, and instead make an API call to create the release commit using a createCommitOnBranch API call

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked PRs that are blocked by other issues or PRs. meta Issues and PRs related to the general management of the project. tools Issues and PRs related to the tools directory.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants