Skip to content

Commit 81f6a55

Browse files
committed
move ownership check exclusion to separate pr
1 parent 8f7b457 commit 81f6a55

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

.github/scripts/triage/check-changes-ownership.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,17 @@ const prNumber: number = +process.env.PR_NUMBER!;
88
const changes: string[] = process.env.CHANGED_FILES!.split(',');
99

1010
/**
11-
* Checks if the PR already has the 'triage:accepted:ready' or 'triage:accepted:ready-with-sig' label, meaning the triage checks should be skipped.
12-
* Also checks if the PR title starts with '[chore]' which indicates a maintenance PR that should skip checks.
13-
* @returns true if the PR has the 'triage:accepted:ready' or 'triage:accepted:ready-with-sig' label or title starts with '[chore]', false otherwise.
11+
* Checks if the PR already has the 'triage:accepted:ready' label, meaning the triage checks should be skipped.
12+
* @returns true if the PR has the 'triage:accepted:ready' assigned to it, false otherwise.
1413
*/
1514
async function shouldSkipCheck() {
16-
const result = await octokit.request("GET /repos/{owner}/{repo}/issues/{issue_number}", {
15+
const result = await octokit.request("GET /repos/{owner}/{repo}/issues/{issue_number}/labels", {
1716
owner: owner,
1817
repo: repo,
1918
issue_number: prNumber
2019
});
2120

22-
const hasAcceptedLabel = result.data.labels?.some(l =>
23-
l.name === "triage:accepted:ready" || l.name === "triage:accepted:ready-with-sig"
24-
) ?? false;
25-
const isChore = result.data.title.toLowerCase().startsWith('[chore]');
26-
27-
return hasAcceptedLabel || isChore;
21+
return result.data.some(l => l.name === "triage:accepted:ready");
2822
}
2923

3024
function getCommentText(changesWithoutOwners: string[]): string {

0 commit comments

Comments
 (0)