fix: update workflows for better automation (#14809)
This commit is contained in:
9
.github/workflows/compliance-close.yml
vendored
9
.github/workflows/compliance-close.yml
vendored
@@ -65,6 +65,15 @@ jobs:
|
|||||||
body: closeMessage,
|
body: closeMessage,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
try {
|
||||||
|
await github.rest.issues.removeLabel({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
issue_number: item.number,
|
||||||
|
name: 'needs:compliance',
|
||||||
|
});
|
||||||
|
} catch (e) {}
|
||||||
|
|
||||||
if (isPR) {
|
if (isPR) {
|
||||||
await github.rest.pulls.update({
|
await github.rest.pulls.update({
|
||||||
owner: context.repo.owner,
|
owner: context.repo.owner,
|
||||||
|
|||||||
12
.github/workflows/pr-standards.yml
vendored
12
.github/workflows/pr-standards.yml
vendored
@@ -108,11 +108,11 @@ jobs:
|
|||||||
|
|
||||||
await removeLabel('needs:title');
|
await removeLabel('needs:title');
|
||||||
|
|
||||||
// Step 2: Check for linked issue (skip for docs/refactor PRs)
|
// Step 2: Check for linked issue (skip for docs/refactor/feat PRs)
|
||||||
const skipIssueCheck = /^(docs|refactor)\s*(\([a-zA-Z0-9-]+\))?\s*:/.test(title);
|
const skipIssueCheck = /^(docs|refactor|feat)\s*(\([a-zA-Z0-9-]+\))?\s*:/.test(title);
|
||||||
if (skipIssueCheck) {
|
if (skipIssueCheck) {
|
||||||
await removeLabel('needs:issue');
|
await removeLabel('needs:issue');
|
||||||
console.log('Skipping issue check for docs/refactor PR');
|
console.log('Skipping issue check for docs/refactor/feat PR');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const query = `
|
const query = `
|
||||||
@@ -189,7 +189,7 @@ jobs:
|
|||||||
|
|
||||||
const body = pr.body || '';
|
const body = pr.body || '';
|
||||||
const title = pr.title;
|
const title = pr.title;
|
||||||
const isDocsOrRefactor = /^(docs|refactor)\s*(\([a-zA-Z0-9-]+\))?\s*:/.test(title);
|
const isDocsRefactorOrFeat = /^(docs|refactor|feat)\s*(\([a-zA-Z0-9-]+\))?\s*:/.test(title);
|
||||||
|
|
||||||
const issues = [];
|
const issues = [];
|
||||||
|
|
||||||
@@ -225,8 +225,8 @@ jobs:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check: issue reference (skip for docs/refactor)
|
// Check: issue reference (skip for docs/refactor/feat)
|
||||||
if (!isDocsOrRefactor && hasIssueSection) {
|
if (!isDocsRefactorOrFeat && hasIssueSection) {
|
||||||
const issueMatch = body.match(/### Issue for this PR\s*\n([\s\S]*?)(?=###|$)/);
|
const issueMatch = body.match(/### Issue for this PR\s*\n([\s\S]*?)(?=###|$)/);
|
||||||
const issueContent = issueMatch ? issueMatch[1].trim() : '';
|
const issueContent = issueMatch ? issueMatch[1].trim() : '';
|
||||||
const hasIssueRef = /(closes|fixes|resolves)\s+#\d+/i.test(issueContent) || /#\d+/.test(issueContent);
|
const hasIssueRef = /(closes|fixes|resolves)\s+#\d+/i.test(issueContent) || /#\d+/.test(issueContent);
|
||||||
|
|||||||
Reference in New Issue
Block a user