浏览代码

fix: update workflows for better automation (#14809)

Ryan Vogel 5 月之前
父节点
当前提交
24c63914bf
共有 2 个文件被更改,包括 15 次插入6 次删除
  1. 9 0
      .github/workflows/compliance-close.yml
  2. 6 6
      .github/workflows/pr-standards.yml

+ 9 - 0
.github/workflows/compliance-close.yml

@@ -65,6 +65,15 @@ jobs:
                 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) {
                 await github.rest.pulls.update({
                   owner: context.repo.owner,

+ 6 - 6
.github/workflows/pr-standards.yml

@@ -108,11 +108,11 @@ jobs:
 
             await removeLabel('needs:title');
 
-            // Step 2: Check for linked issue (skip for docs/refactor PRs)
-            const skipIssueCheck = /^(docs|refactor)\s*(\([a-zA-Z0-9-]+\))?\s*:/.test(title);
+            // Step 2: Check for linked issue (skip for docs/refactor/feat PRs)
+            const skipIssueCheck = /^(docs|refactor|feat)\s*(\([a-zA-Z0-9-]+\))?\s*:/.test(title);
             if (skipIssueCheck) {
               await removeLabel('needs:issue');
-              console.log('Skipping issue check for docs/refactor PR');
+              console.log('Skipping issue check for docs/refactor/feat PR');
               return;
             }
             const query = `
@@ -189,7 +189,7 @@ jobs:
 
             const body = pr.body || '';
             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 = [];
 
@@ -225,8 +225,8 @@ jobs:
               }
             }
 
-            // Check: issue reference (skip for docs/refactor)
-            if (!isDocsOrRefactor && hasIssueSection) {
+            // Check: issue reference (skip for docs/refactor/feat)
+            if (!isDocsRefactorOrFeat && hasIssueSection) {
               const issueMatch = body.match(/### Issue for this PR\s*\n([\s\S]*?)(?=###|$)/);
               const issueContent = issueMatch ? issueMatch[1].trim() : '';
               const hasIssueRef = /(closes|fixes|resolves)\s+#\d+/i.test(issueContent) || /#\d+/.test(issueContent);