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 commit message linting to workflow #32336

Closed
wants to merge 1 commit into from

Conversation

richardlau
Copy link
Member

Run linting on the commit message of the first commit in a pull
request as part of our GitHub actions CI workflow. If linting fails
the pull request will be labelled as requiring a fix to the commit
message. The check itself will always pass so as to not concern
first time contributors.

This is a different approach to the commit message linting that
is currently run on Travis CI. The new label introduced by this
pull request (needs commit message fix) could also be added
manually for cases where the commit message needs updating
before landing for things not caught by core-validate-commit
(e.g. typos). We can also teach node-core-utils to check for the
label when landing pull requests (for those things not caught by
core-validate-commit).

Checklist

@nodejs-github-bot nodejs-github-bot added the meta Issues and PRs related to the general management of the project. label Mar 18, 2020
@mmarchini
Copy link
Contributor

mmarchini commented Mar 18, 2020

FYI this will not work because it is using GITHUB_TOKEN and most all PRs we receive come from forks (GITHUB_TOKEN for PRs coming from forks are read-only, meaning they can't set labels, send comments, etc.).

Edit: this is easy to test by the way, change the commit message to something not following our guidelines :)

Run linting on the commit message of the first commit in a pull
request as part of our GitHub actions CI workflow. If linting fails
the pull request will be labelled as requiring a fix to the commit
message. The check itself will always pass so as to not concern
first time contributors.

Signed-off-by: Richard Lau <riclau@uk.ibm.com>
@richardlau
Copy link
Member Author

richardlau commented Mar 18, 2020

FYI this will not work because it is using GITHUB_TOKEN and most all PRs we receive come from forks (GITHUB_TOKEN for PRs coming from forks are read-only, meaning they can't set labels, send comments, etc.).

Edit: this is easy to test by the way, change the commit message to something not following our guidelines :)

Yes, you're right.

https://github.com/nodejs/node/pull/32336/checks?check_run_id=515383424#step:5:9

ℹ  info      label [ 'needs commit message fix' ]
✖  fatal     HttpError: Resource not accessible by integration 
    at /node_modules/@octokit/request/lib/request.js:56:27
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async Object.doLabel [as label] (/entrypoint.js:61:5)
action failed

Pity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meta Issues and PRs related to the general management of the project.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants