Skip to content

Commit

Permalink
fix(manage-merge-queue): improve logging further (#658)
Browse files Browse the repository at this point in the history
  • Loading branch information
danadajian authored Aug 22, 2024
1 parent 28f44ef commit 1cb1521
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 10 deletions.
4 changes: 2 additions & 2 deletions dist/374.index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/374.index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions dist/676.index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/676.index.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/helpers/is-user-in-team.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const isUserInTeam = async ({ login = context.actor, team }: IsUserInTeam
org: context.repo.owner,
team_slug: team
});
core.debug(`Checking if ${login} is in team ${team}`);
core.debug(`Team members: ${response.data.map(({ login }) => login).join(', ')}`);
core.info(`Checking if ${login} is in team ${team}`);
core.info(`Team members: ${response.data.map(({ login }) => login).join(', ')}`);
return response.data.some(({ login: memberLogin }) => memberLogin === login);
};
3 changes: 2 additions & 1 deletion src/helpers/manage-merge-queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ export const manageMergeQueue = async ({
}
if (pullRequest.labels.find(label => label.name === JUMP_THE_QUEUE_PR_LABEL)) {
if (allow_only_for_maintainers === 'true') {
const isMaintainer = await isUserInTeam({ login, team: team });
core.info(`Checking if user ${login} is a maintainer...`);
const isMaintainer = await isUserInTeam({ team: team });
if (!isMaintainer) {
await removeLabelIfExists(JUMP_THE_QUEUE_PR_LABEL, pullRequest.number);
return await createPrComment({
Expand Down

0 comments on commit 1cb1521

Please sign in to comment.