Skip to content

Commit 24c6391

Browse files
authored
fix: update workflows for better automation (anomalyco#14809)
1 parent 8f2d8dd commit 24c6391

2 files changed

Lines changed: 15 additions & 6 deletions

File tree

.github/workflows/compliance-close.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,15 @@ jobs:
6565
body: closeMessage,
6666
});
6767
68+
try {
69+
await github.rest.issues.removeLabel({
70+
owner: context.repo.owner,
71+
repo: context.repo.repo,
72+
issue_number: item.number,
73+
name: 'needs:compliance',
74+
});
75+
} catch (e) {}
76+
6877
if (isPR) {
6978
await github.rest.pulls.update({
7079
owner: context.repo.owner,

.github/workflows/pr-standards.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,11 @@ jobs:
108108
109109
await removeLabel('needs:title');
110110
111-
// Step 2: Check for linked issue (skip for docs/refactor PRs)
112-
const skipIssueCheck = /^(docs|refactor)\s*(\([a-zA-Z0-9-]+\))?\s*:/.test(title);
111+
// Step 2: Check for linked issue (skip for docs/refactor/feat PRs)
112+
const skipIssueCheck = /^(docs|refactor|feat)\s*(\([a-zA-Z0-9-]+\))?\s*:/.test(title);
113113
if (skipIssueCheck) {
114114
await removeLabel('needs:issue');
115-
console.log('Skipping issue check for docs/refactor PR');
115+
console.log('Skipping issue check for docs/refactor/feat PR');
116116
return;
117117
}
118118
const query = `
@@ -189,7 +189,7 @@ jobs:
189189
190190
const body = pr.body || '';
191191
const title = pr.title;
192-
const isDocsOrRefactor = /^(docs|refactor)\s*(\([a-zA-Z0-9-]+\))?\s*:/.test(title);
192+
const isDocsRefactorOrFeat = /^(docs|refactor|feat)\s*(\([a-zA-Z0-9-]+\))?\s*:/.test(title);
193193
194194
const issues = [];
195195
@@ -225,8 +225,8 @@ jobs:
225225
}
226226
}
227227
228-
// Check: issue reference (skip for docs/refactor)
229-
if (!isDocsOrRefactor && hasIssueSection) {
228+
// Check: issue reference (skip for docs/refactor/feat)
229+
if (!isDocsRefactorOrFeat && hasIssueSection) {
230230
const issueMatch = body.match(/### Issue for this PR\s*\n([\s\S]*?)(?=###|$)/);
231231
const issueContent = issueMatch ? issueMatch[1].trim() : '';
232232
const hasIssueRef = /(closes|fixes|resolves)\s+#\d+/i.test(issueContent) || /#\d+/.test(issueContent);

0 commit comments

Comments
 (0)