mirror of
https://github.com/nodejs/node.git
synced 2026-10-29 02:35:20 +08:00
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 7.0.0 to 7.1.0. - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/820762786026740c76f36085b0efc47a31fe5020...949feb2413d6458794dcd2491c4babbbce0c15c1) --- updated-dependencies: - dependency-name: actions/setup-node dependency-version: 7.1.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> PR-URL: https://github.com/nodejs/node/pull/67032 Reviewed-By: Christian Clauss <cclauss@me.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
57 lines
1.8 KiB
YAML
57 lines
1.8 KiB
YAML
name: First commit message adheres to guidelines
|
|
|
|
on:
|
|
pull_request_target:
|
|
branches:
|
|
- main
|
|
|
|
env:
|
|
NODE_VERSION: lts/*
|
|
|
|
permissions:
|
|
pull-requests: read
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
lint-commit-message:
|
|
name: lint-commit-message
|
|
runs-on: ubuntu-slim
|
|
steps:
|
|
- name: Install Node.js
|
|
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
|
with:
|
|
node-version: ${{ env.NODE_VERSION }}
|
|
- name: Validate first commit message
|
|
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
|
|
with:
|
|
script: |
|
|
const { data: [commit] } = await github.rest.pulls.listCommits({
|
|
...context.repo,
|
|
pull_number: context.issue.number,
|
|
per_page: 1,
|
|
});
|
|
if (!commit) {
|
|
throw new Error('No commits found in pull request');
|
|
}
|
|
const { exitCode, stdout, stderr } = await exec.getExecOutput('npx', [
|
|
'-q', '--yes', '--ignore-scripts', 'core-validate-commit@6.0.0',
|
|
'--no-validate-metadata', '--tap', '-',
|
|
], {
|
|
cwd: process.env.RUNNER_TEMP,
|
|
input: Buffer.from(JSON.stringify([{
|
|
id: commit.sha,
|
|
message: commit.commit.message,
|
|
author: commit.commit.author,
|
|
}])),
|
|
silent: true,
|
|
ignoreReturnCode: true,
|
|
});
|
|
if (exitCode !== 0) {
|
|
core.setFailed(stdout + stderr || 'Commit message validation failed');
|
|
} else {
|
|
core.info('First commit message passes validation');
|
|
}
|