Skip to content

Commit 6a44792

Browse files
committed
Update 1763947000
1 parent 168bdc9 commit 6a44792

1 file changed

Lines changed: 20 additions & 2 deletions

File tree

.github/workflows/auto-assign.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,26 @@ jobs:
154154
// grab assignments from issues created by other non-members
155155
if (isAssign) {
156156
const issueCreator = issue.user.login;
157-
const issueCreatorAssociation = issue.author_association;
158-
157+
let issueCreatorAssociation;
158+
159+
// Fetch author_association via REST API since it's no longer in event payload
160+
try {
161+
const issueDetails = await github.rest.issues.get({
162+
owner,
163+
repo,
164+
issue_number: issueNumber
165+
});
166+
issueCreatorAssociation = issueDetails.data.author_association;
167+
} catch (error) {
168+
console.error(`Error fetching issue details for #${issueNumber}:`, error);
169+
await github.rest.issues.createComment({
170+
owner,
171+
repo,
172+
issue_number: issueNumber,
173+
body: `❌ Failed to verify issue permissions. Please contact a maintainer or try again later.`,
174+
});
175+
return;
176+
}
159177
console.log(`Issue #${issueNumber} creator ${issueCreator} has association: ${issueCreatorAssociation}`);
160178
161179
// Only allow /assign on issues created by OWNER, MEMBER, COLLABORATOR or CONTRIBUTOR

0 commit comments

Comments
 (0)