mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-10 22:21:22 -07:00
fix(workflows): use author_association for maintainer check (#17060)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user