Bumps [actions/checkout](https://github.com/actions/checkout) from 6.0.2 to 6.0.3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](de0fac2e45...df4cb1c069)
---
updated-dependencies:
- dependency-name: actions/checkout
dependency-version: 6.0.3
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
PR-URL: https://github.com/nodejs/node/pull/63726
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
109 lines
4.7 KiB
YAML
109 lines
4.7 KiB
YAML
name: Linters (release proposals)
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- v[0-9]+.[0-9]+.[0-9]+-proposal
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
|
cancel-in-progress: true
|
|
|
|
env:
|
|
PYTHON_VERSION: '3.14'
|
|
NODE_VERSION: lts/*
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
lint-release-commit:
|
|
runs-on: ubuntu-slim
|
|
permissions:
|
|
contents: read
|
|
pull-requests: read
|
|
steps:
|
|
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
with:
|
|
persist-credentials: false
|
|
fetch-depth: 2
|
|
- name: Lint release commit title format
|
|
run: |
|
|
EXPECTED_TITLE='^[[:digit:]]{4}-[[:digit:]]{2}-[[:digit:]]{2}, Version [[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+ (\(Current|'.+' \(LTS)\)$'
|
|
echo "Expected commit title format: $EXPECTED_TITLE"
|
|
COMMIT_SUBJECT="$(git --no-pager log -1 --format=%s)"
|
|
echo "Actual: $ACTUAL"
|
|
echo "$COMMIT_SUBJECT" | grep -q -E "$EXPECTED_TITLE"
|
|
echo "COMMIT_SUBJECT=$COMMIT_SUBJECT" >> "$GITHUB_ENV"
|
|
- name: Lint release commit message trailers
|
|
run: |
|
|
EXPECTED_TRAILER="^$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/pull/[[:digit:]]+\$"
|
|
echo "Expected trailer format: $EXPECTED_TRAILER"
|
|
PR_URL="$(git --no-pager log -1 --format='%(trailers:key=PR-URL,valueonly)')"
|
|
echo "Actual: $PR_URL"
|
|
echo "$PR_URL" | grep -E -q "$EXPECTED_TRAILER"
|
|
|
|
PR_HEAD="$(gh pr view "$PR_URL" --json headRefOid -q .headRefOid)"
|
|
echo "Head of $PR_URL: $PR_HEAD"
|
|
echo "Current commit: $GITHUB_SHA"
|
|
[ "$PR_HEAD" = "$GITHUB_SHA" ]
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
- name: Verify it's release-ready
|
|
run: |
|
|
SKIP_XZ=1 make release-only
|
|
- name: Lint release commit content
|
|
run: |
|
|
MAJOR="$(awk '/^#define NODE_MAJOR_VERSION / { print $3 }' src/node_version.h)"
|
|
|
|
echo "Checking for expected files in the release commit:"
|
|
missing_expected=
|
|
for expected in CHANGELOG.md src/node_version.h doc/changelogs/; do
|
|
if git diff --exit-code --quiet --diff-filter=M HEAD^ -- "$expected"; then
|
|
echo "Missing expected file in diff: $expected"
|
|
missing_expected=1
|
|
fi
|
|
done
|
|
[ -z "$missing_expected" ] || exit 1
|
|
|
|
echo "Checking for unexpected files in the release commit:"
|
|
set -ex
|
|
[ -z "$(git diff-tree --no-commit-id --name-only -r HEAD --\
|
|
. \
|
|
':(exclude)CHANGELOG.md' \
|
|
':(exclude)src/node_version.h' \
|
|
':(exclude)test/parallel/test-process-release.js' \
|
|
':(exclude)doc/abi_version_registry.json' \
|
|
':(exclude)doc/api/' \
|
|
":(exclude)doc/changelogs/")" ]
|
|
- name: Validate CHANGELOG
|
|
id: releaser-info
|
|
run: |
|
|
EXPECTED_CHANGELOG_TITLE_INTRO="## $COMMIT_SUBJECT, @"
|
|
echo "Expected CHANGELOG section title: $EXPECTED_CHANGELOG_TITLE_INTRO"
|
|
MAJOR="$(awk '/^#define NODE_MAJOR_VERSION / { print $3 }' src/node_version.h)"
|
|
CHANGELOG_PATH="doc/changelogs/CHANGELOG_V${MAJOR}.md"
|
|
CHANGELOG_TITLE="$(grep "$EXPECTED_CHANGELOG_TITLE_INTRO" "$CHANGELOG_PATH")"
|
|
echo "Actual: $CHANGELOG_TITLE"
|
|
[ "${CHANGELOG_TITLE%%@*}@" = "$EXPECTED_CHANGELOG_TITLE_INTRO" ]
|
|
gh api \
|
|
-H "Accept: application/vnd.github+json" \
|
|
-H "X-GitHub-Api-Version: 2022-11-28" \
|
|
--jq '.commits.[] | { smallSha: .sha[0:10] } + (.commit.message|capture("^(?<title>.+)\n\n(.*\n)*PR-URL: (?<prURL>.+)(\n|$)"))' \
|
|
"/repos/${GITHUB_REPOSITORY}/compare/v${MAJOR}.x...$GITHUB_SHA" --paginate \
|
|
| node tools/actions/lint-release-proposal-commit-list.mjs "$CHANGELOG_PATH" "$GITHUB_SHA" \
|
|
| while IFS= read -r PR_URL; do
|
|
DONT_LAND_LABEL="dont-land-on-v${MAJOR}.x" LTS_WATCH_LABEL="lts-watch-v${MAJOR}.x" gh pr view \
|
|
--json labels,url \
|
|
--jq '
|
|
if (.labels|any(.name==env.DONT_LAND_LABEL)) then
|
|
error("\(.url) has the \(env.DONT_LAND_LABEL) label, forbidding it to be in this release proposal")
|
|
elif (.labels|any(.name==env.LTS_WATCH_LABEL)) then
|
|
error("\(.url) has the \(env.LTS_WATCH_LABEL) label, please remove the label now that the PR is included in a release proposal")
|
|
end
|
|
' \
|
|
"$PR_URL" > /dev/null
|
|
done
|
|
shell: bash # See https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference, we want the pipefail option.
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|