fix(workflows): use author_association for maintainer check (#17060)

This commit is contained in:
Bryan Morgan
2026-01-19 22:05:15 -05:00
committed by GitHub
parent 0bebc664c1
commit 05c0a8eac3

View File

@@ -33,19 +33,12 @@ jobs:
const repo = context.repo.repo;
const username = context.payload.pull_request.user.login;
const pr_number = context.payload.pull_request.number;
const team_slug = 'gemini-cli-maintainers';
// 1. Check if the PR author is a maintainer
try {
await github.rest.teams.getMembershipForUserInOrg({
org,
team_slug,
username,
});
core.info(`${username} is a maintainer. No notification needed.`);
const authorAssociation = context.payload.pull_request.author_association;
if (['OWNER', 'MEMBER', 'COLLABORATOR'].includes(authorAssociation)) {
core.info(`${username} is a maintainer (Association: ${authorAssociation}). No notification needed.`);
return;
} catch (error) {
if (error.status !== 404) throw error;
}
// 2. Check if the PR is already associated with an issue