Skip to content

docs: standardise NumPy docstrings across public API #12

docs: standardise NumPy docstrings across public API

docs: standardise NumPy docstrings across public API #12

Workflow file for this run

name: changelog
on:
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
- edited
- labeled
- unlabeled
permissions:
contents: read
pull-requests: read
jobs:
require-changelog:
runs-on: ubuntu-latest
steps:
- name: Enforce changelog policy
uses: actions/github-script@v7
with:
script: |
const pr = context.payload.pull_request;
if (!pr) {
core.info("No pull request payload found.");
return;
}
if (pr.draft) {
core.notice("Draft PR: changelog enforcement will run again when the PR is marked ready for review.");
return;
}
const labels = new Set((pr.labels || []).map((label) => label.name));
if (labels.has("skip-changelog")) {
core.notice("Skipping changelog check because the PR has the skip-changelog label.");
return;
}
const files = await github.paginate(github.rest.pulls.listFiles, {
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: pr.number,
per_page: 100,
});
const changedFiles = files.map((file) => file.filename);
if (changedFiles.includes("CHANGELOG.md")) {
core.notice("CHANGELOG.md was updated in this PR.");
return;
}
const exemptFiles = new Set([
"README.md",
"CHANGELOG.md",
"LICENSE",
"mkdocs.yml",
"uv.lock",
".gitignore",
".pre-commit-config.yaml",
]);
const exemptPrefixes = [
".github/",
"docs/",
"tests/",
];
const requiresChangelog = changedFiles.filter((file) => {
if (exemptFiles.has(file)) {
return false;
}
if (exemptPrefixes.some((prefix) => file.startsWith(prefix))) {
return false;
}
return true;
});
if (requiresChangelog.length === 0) {
core.notice("Only docs/tests/CI/internal files changed, so no changelog entry is required.");
return;
}
const details = requiresChangelog.slice(0, 20).map((file) => `- ${file}`).join("\n");
core.setFailed(
[
"This PR changes user-facing or package-relevant files but does not update CHANGELOG.md.",
"Add a changelog entry, or apply the skip-changelog label if the change is intentionally internal.",
"",
"Files that triggered this check:",
details,
].join("\n"),
);