Skip to content

chore(deps-dev): bump eslint from 8.57.1 to 10.5.0 #2168

chore(deps-dev): bump eslint from 8.57.1 to 10.5.0

chore(deps-dev): bump eslint from 8.57.1 to 10.5.0 #2168

name: changelog-validate
on:
pull_request:
branches: [develop]
types:
[
opened,
synchronize,
reopened,
edited,
ready_for_review,
labeled,
unlabeled,
]
permissions:
contents: read
pull-requests: read
jobs:
validate:
if: github.actor != 'imgbot[bot]'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Require changelog update or skip label
id: changelog_gate
uses: actions/github-script@v7
with:
script: |
const cp = require("node:child_process");
const author = context.payload.pull_request?.user?.login || "";
const labels = (context.payload.pull_request?.labels || []).map((l) => l.name);
const has = (name) => labels.includes(name);
if (author === "dependabot[bot]" || author === "app/dependabot") {
core.info("Skipping changelog requirement for Dependabot pull requests.");
core.setOutput("run_validation", "false");
return;
}
if (has("meta:needs-changelog") && has("meta:no-changelog")) {
core.setFailed("PR cannot include both meta:needs-changelog and meta:no-changelog.");
return;
}
const restrictedTypes = new Set([
"type:feature",
"type:bug",
"type:performance",
"type:security",
"type:release",
"type:hotfix",
]);
if (has("meta:no-changelog") && labels.some((label) => restrictedTypes.has(label))) {
core.setFailed("meta:no-changelog is not allowed for high-impact release-related change types.");
return;
}
const baseSha = context.payload.pull_request?.base?.sha;
const headSha = context.payload.pull_request?.head?.sha;
const changed = cp
.execSync(`git diff --name-only ${baseSha} ${headSha}`, {
encoding: "utf8",
maxBuffer: 1024 * 1024 * 100,
})
.split("\n")
.filter(Boolean);
if (changed.includes("CHANGELOG.md")) {
core.info("CHANGELOG.md updated in PR diff.");
core.setOutput("run_validation", "true");
return;
}
if (has("meta:no-changelog")) {
core.info("Skipping changelog requirement due to meta:no-changelog label.");
core.setOutput("run_validation", "false");
return;
}
core.setFailed("PR requires a CHANGELOG.md update or the meta:no-changelog label.");
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "22.22.1"
- name: Validate changelog schema
if: steps.changelog_gate.outputs.run_validation == 'true'
run: |
node scripts/agents/includes/changelogUtils.cjs --validate CHANGELOG.md
node scripts/validation/validate-changelog.cjs CHANGELOG.md