-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
tools: add script to lint first PR commit message #24030
Conversation
Examples: Run locally, no pull request specified (script works out based on current HEAD commit):
Checking a completely different PR:
On Travis (for this PR), https://travis-ci.com/nodejs/node/jobs/155889224: |
Decouple first commit in pull request linting from Travis by using the GitHub API to work out the first commit. The shell script obtains the pull request number in one of the following ways: 1) supplied on the command line (use this to test against any PR) 2) derived from the HEAD commit via the GitHub API
826115e
to
38f2b1e
Compare
Moved the Travis specific stuff out of the script back into |
Longer term we could teach
and then replace the shell script here with a direct call to |
Decouple first commit in pull request linting from Travis by using the GitHub API to work out the first commit. The shell script obtains the pull request number in one of the following ways: 1) supplied on the command line (use this to test against any PR) 2) derived from the HEAD commit via the GitHub API PR-URL: nodejs#24030 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Landed in 7489ee8 |
@Trott @richardlau This seems to have broken Travis CI for non-PR branches without |
Do not run any linting at all when `TRAVIS_PULL_REQUEST` is `false`. This would otherwise break Travis CI for `master` and release branches. Refs: nodejs#24030
Do not run any linting at all when `TRAVIS_PULL_REQUEST` is `false`. This would otherwise break Travis CI for `master` and release branches. Refs: nodejs#24030 PR-URL: nodejs#24076 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Decouple first commit in pull request linting from Travis by using the GitHub API to work out the first commit. The shell script obtains the pull request number in one of the following ways: 1) supplied on the command line (use this to test against any PR) 2) derived from the HEAD commit via the GitHub API PR-URL: #24030 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Do not run any linting at all when `TRAVIS_PULL_REQUEST` is `false`. This would otherwise break Travis CI for `master` and release branches. Refs: #24030 PR-URL: #24076 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Decouple first commit in pull request linting from Travis by using the GitHub API to work out the first commit. The shell script obtains the pull request number in one of the following ways: 1) supplied on the command line (use this to test against any PR) 2) derived from the HEAD commit via the GitHub API PR-URL: #24030 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Do not run any linting at all when `TRAVIS_PULL_REQUEST` is `false`. This would otherwise break Travis CI for `master` and release branches. Refs: #24030 PR-URL: #24076 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Decouple first commit in pull request linting from Travis by using the GitHub API to work out the first commit. The shell script obtains the pull request number in one of the following ways: 1) supplied on the command line (use this to test against any PR) 2) derived from the HEAD commit via the GitHub API PR-URL: #24030 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Do not run any linting at all when `TRAVIS_PULL_REQUEST` is `false`. This would otherwise break Travis CI for `master` and release branches. Refs: #24030 PR-URL: #24076 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Decouple first commit in pull request linting from Travis by using the GitHub API to work out the first commit. The shell script obtains the pull request number in one of the following ways: 1) supplied on the command line (use this to test against any PR) 2) derived from the HEAD commit via the GitHub API PR-URL: #24030 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Do not run any linting at all when `TRAVIS_PULL_REQUEST` is `false`. This would otherwise break Travis CI for `master` and release branches. Refs: #24030 PR-URL: #24076 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Decouple first commit in pull request linting from Travis by using
the GitHub API to work out the first commit.
The shell script obtains the pull request number in one of the
following ways:
The GitHub API should be more consistent with the web UI in terms of finding
the first commit for a pull request.
This is an alternative to #23758 with the bonus that
you can run the script against any pull request number.
Checklist