Skip to content

Commit 6d9539f

Browse files
fix: exempt org issues from compliance close (anomalyco#34431)
1 parent e5101d9 commit 6d9539f

2 files changed

Lines changed: 21 additions & 1 deletion

File tree

.github/workflows/compliance-close.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,25 @@ jobs:
3434
3535
const now = Date.now();
3636
const twoHours = 2 * 60 * 60 * 1000;
37+
const orgMemberAssociations = new Set(['OWNER', 'MEMBER']);
3738
3839
for (const item of items) {
3940
const isPR = !!item.pull_request;
4041
const kind = isPR ? 'PR' : 'issue';
4142
43+
if (orgMemberAssociations.has(item.author_association)) {
44+
core.info(`Skipping ${kind} #${item.number}; author association is ${item.author_association}`);
45+
try {
46+
await github.rest.issues.removeLabel({
47+
owner: context.repo.owner,
48+
repo: context.repo.repo,
49+
issue_number: item.number,
50+
name: 'needs:compliance',
51+
});
52+
} catch (e) {}
53+
continue;
54+
}
55+
4256
const { data: comments } = await github.rest.issues.listComments({
4357
owner: context.repo.owner,
4458
repo: context.repo.repo,

.github/workflows/duplicate-issues.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ jobs:
3838
opencode run -m opencode/claude-sonnet-4-6 "A new issue has been created:
3939
4040
Issue number: ${{ github.event.issue.number }}
41+
Issue author association: ${{ github.event.issue.author_association }}
4142
4243
Lookup this issue with gh issue view ${{ github.event.issue.number }}.
4344
@@ -49,6 +50,8 @@ jobs:
4950
5051
Check whether the issue follows our contributing guidelines and issue templates.
5152
53+
If the issue author association is OWNER or MEMBER, skip this compliance check. Do not add the needs:compliance label for organization-owned issues.
54+
5255
This project has three issue templates that every issue MUST use one of:
5356
5457
1. Bug Report - requires a Description field with real content
@@ -83,7 +86,7 @@ jobs:
8386
8487
Based on your findings, post a SINGLE comment on issue #${{ github.event.issue.number }}. Build the comment as follows:
8588
86-
If the issue is NOT compliant, start the comment with:
89+
If the issue is NOT compliant and the author association is not OWNER or MEMBER, start the comment with:
8790
<!-- issue-compliance -->
8891
Then explain what needs to be fixed and that they have 2 hours to edit the issue before it is automatically closed. Also add the label needs:compliance to the issue using: gh issue edit ${{ github.event.issue.number }} --add-label needs:compliance
8992
@@ -148,9 +151,12 @@ jobs:
148151
}
149152
run: |
150153
opencode run -m opencode/claude-sonnet-4-6 "Issue #${{ github.event.issue.number }} was previously flagged as non-compliant and has been edited.
154+
Issue author association: ${{ github.event.issue.author_association }}
151155
152156
Lookup this issue with gh issue view ${{ github.event.issue.number }}.
153157
158+
If the issue author association is OWNER or MEMBER, remove the needs:compliance label if present, delete the previous compliance comment if present, and do not post a new comment.
159+
154160
Re-check whether the issue now follows our contributing guidelines and issue templates.
155161
156162
This project has three issue templates that every issue MUST use one of:

0 commit comments

Comments
 (0)