Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(eslint-plugin): [no-redundant-type-constituents] skip reporting when type is a recursive array type#974

fix(eslint-plugin): [no-redundant-type-constituents] skip reporting when type is a recursive array type

fix(eslint-plugin): [no-redundant-type-constituents] skip reporting when type is a recursive array type #974

# IMPORTANT: Do not reuse old name of "Semantic Breaking Change PR Test" here
name:Breaking Change Validation
on:
# WARNING: Using pull_request_target here because we want to validate PRs on forks
# pull_request_target can be UNSAFE because it runs in the TARGET repo context (not fork context).
# DO NOT CHECK OUT THE REPO IN THIS WORKFLOW
pull_request_target:
types:
-opened
-edited
-synchronize
-labeled
-unlabeled
# IMPORTANT: Minimal permissions necessary for this workflow to function
permissions:
pull-requests:read
jobs:
validate:
name:Validate Breaking Change PR
runs-on:ubuntu-latest
steps:
-name:Check PR title and body
uses:actions/github-script@v7
with:
github-token:${{ secrets.GITHUB_TOKEN }}
script:|
async function getPullRequest() {
const pr = context.payload.pull_request;
if (!pr) {
throw new Error("This action can only be run on pull_request events.");
}
const owner = pr.base.repo.owner.login;
const repo = pr.base.repo.name;
const pull_number = pr.number;
const { data } = await github.rest.pulls.get({
owner,
repo,
pull_number,
});
return data;
}
function checkTitle(title) {
if (/^[a-z]+(\([a-z-]+\))?!: /.test(title)) {
throw new Error(
`Do not use exclamation mark ('!') to indicate breaking change in the PR Title.`,
);
}
}
function checkDescription(body, labels) {
if (!labels.some(label => label.name === 'breaking change')) {
return;
}
const [firstLine, secondLine] = body.split(/\r?\n/);
if (!firstLine || !/^BREAKING CHANGE:/.test(firstLine)) {
throw new Error(
`Breaking change PR body should start with "BREAKING CHANGE:". See https://typescript-eslint.io/maintenance/releases#2-merging-breaking-changes.`,
);
}
if (!secondLine) {
throw new Error(
`The description of breaking change is missing. See https://typescript-eslint.io/maintenance/releases#2-merging-breaking-changes.`,
);
}
}
const pr = await getPullRequest();
checkTitle(pr.title);
checkDescription(pr.body ?? '', pr.labels);

[8]ページ先頭

©2009-2025 Movatter.jp