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

chore: add gyp-next updater #3105

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

legendecas
Copy link
Member

Add automated updater for gyp-next.

Example: legendecas#1

  • Add nodejs-github-bot token

Copy link
Contributor

@cclauss cclauss left a comment

Choose a reason for hiding this comment

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

Nice!

.github/workflows/update-gyp-next.yml Show resolved Hide resolved
subprocess.check_output(["git", "commit", "-m", "feat(gyp): update gyp to " + args.tag])
if not args.no_commit:
subprocess.check_output(["git", "add", "gyp"], cwd=CHECKOUT_PATH)
subprocess.check_output(["git", "commit", "-m", "feat(gyp): update gyp to " + args.tag])
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
subprocess.check_output(["git", "commit", "-m", "feat(gyp): update gyp to " + args.tag])
subprocess.check_output([
"git", "commit", "-m", "feat(gyp): update gyp to " + args.tag
])

Copy link
Member

@lukekarrys lukekarrys left a comment

Choose a reason for hiding this comment

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

This PR is a great idea and will help a lot so I'm +1 on landing it.

The only change I'm requesting is that to use a more specific GitHub token that is only used for updating gyp-next.


jobs:
update-gyp-next:
# if: github.repository == 'nodejs/node' || github.event_name == 'workflow_dispatch'
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
# if: github.repository == 'nodejs/node' || github.event_name == 'workflow_dispatch'

.github/workflows/update-gyp-next.yml Show resolved Hide resolved
.github/workflows/release-please.yml Show resolved Hide resolved
@legendecas
Copy link
Member Author

@lukekarrys the new token permissions are tracked at nodejs/admin#935. It has the same permission needed for release-please and gyp-next updater as:

permissions:
  contents: write
  pull-requests: write

The reason to use a token for release-please is that the token GitHub actions created by default will not trigger GitHub actions:

When you use the repository's GITHUB_TOKEN to perform tasks, events triggered by the GITHUB_TOKEN will not create a new workflow run. This prevents you from accidentally creating recursive workflow runs.
https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/triggering-a-workflow#triggering-a-workflow-from-a-workflow

So we need a token of @nodejs-github-bot, as requested at nodejs/admin#935.

@lukekarrys
Copy link
Member

@legendecas Good call, I forgot about that restriction. I withdraw my previous suggestions and 👍

@lukekarrys
Copy link
Member

@legendecas What do you think about the suggestions in the unresolved comment threads?

@legendecas
Copy link
Member Author

yes, I will update the PR according to the suggestions above once the token is setup. Thanks for catching them!

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

Successfully merging this pull request may close these issues.

3 participants