mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-06 17:13:24 -05:00
workflows/lint: fully skip the commits job in Merge Queues
Follow-up to 7cf5972410
While the JS script already returned early, we can save a few resources
by skipping the job entirely when there's no `pull_request` context.
This commit is contained in:
parent
e97d1c56ad
commit
7cfe9b8c85
2 changed files with 6 additions and 2 deletions
5
.github/workflows/lint.yml
vendored
5
.github/workflows/lint.yml
vendored
|
|
@ -126,6 +126,11 @@ jobs:
|
|||
fi
|
||||
|
||||
commits:
|
||||
# Only check commits if we have access to the pull_request context.
|
||||
#
|
||||
# Luckily there's no need to lint commit messages in the Merge Queue, because
|
||||
# changes to the target branch can't change commit messages on the base branch.
|
||||
if: ${{ github.event.pull_request.number }}
|
||||
runs-on: ubuntu-slim
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
|
|
|
|||
|
|
@ -9,8 +9,7 @@ const { classify } = require('../supportedBranches.js')
|
|||
* }} CheckCommitMessagesProps
|
||||
*/
|
||||
async function checkCommitMessages({ github, context, core }) {
|
||||
// Do not run on merge groups: it'd be much harder, and there is no need
|
||||
// (changes to the target branch can't change commit messages on the base branch).
|
||||
// This check should only be run when we have the pull_request context.
|
||||
const pull_number = context.payload.pull_request?.number
|
||||
if (!pull_number) {
|
||||
core.info('This is not a pull request. Skipping checks.')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue