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

chore: speed up semantic-breaking-change-pr.yml#11286

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
Show all changes
13 commits
Select commitHold shift + click to select a range
d3f8679
feat(breaking-pr-check): Refactored to breaking-pr-check and deleted …
developer-bandiJun 8, 2025
1897bf9
feat: change pr code
developer-bandiJun 8, 2025
a5e66db
refactor: remove unused dependencies
developer-bandiJun 9, 2025
d3ca756
test: rule test
developer-bandiJun 9, 2025
ca3afbf
chore: add test code
developer-bandiJun 9, 2025
712411d
chore: add test logic
developer-bandiJun 9, 2025
34fc314
chore: rename action and remove obsolete workflow file
developer-bandiJun 9, 2025
0aa12b7
feat: add permission
developer-bandiJun 10, 2025
e94356f
fix: token
developer-bandiJun 10, 2025
1e77541
fix: revert test code & lock file update
developer-bandiJun 10, 2025
375efef
fix: remove test code
developer-bandiJun 10, 2025
a8964eb
Merge branch 'main'
JoshuaKGoldbergJun 16, 2025
d32357f
Update .github/actions/breaking-pr-check/action.yml
JoshuaKGoldbergJun 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 57 additions & 2 deletions.github/actions/breaking-pr-check/action.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,5 +2,60 @@ name: Validate Breaking Change PR
description: Validate breaking change PR title and description

runs:
using: node20
main: index.js
using: 'composite'
steps:
- name: Check PR title and body using github-script
uses: actions/github-script@v7
with:
github-token: ${{ env.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);
78 changes: 0 additions & 78 deletions.github/actions/breaking-pr-check/index.js
View file
Open in desktop

This file was deleted.

Original file line numberDiff line numberDiff line change
Expand Up@@ -15,7 +15,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare-install
- uses: ./.github/actions/breaking-pr-check
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 0 additions & 2 deletionspackage.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -51,8 +51,6 @@
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"devDependencies": {
"@actions/core": "^1.10.1",
"@actions/github": "^6.0.0",
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
"@eslint/compat": "^1.2.4",
"@eslint/eslintrc": "^3.2.0",
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp