Skip to content

Commit eab0c00

Browse files
authored
fix(manage-merge-queue): improve email documentation (#692)
1 parent 4823244 commit eab0c00

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

dist/284.index.js

Lines changed: 3 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/284.index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/helpers/manage-merge-queue.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import { updatePrWithDefaultBranch } from './prepare-queued-pr-for-merge';
3232
import { approvalsSatisfied } from './approvals-satisfied';
3333
import { createPrComment } from './create-pr-comment';
3434
import { isUserInTeam } from './is-user-in-team';
35-
import { join } from 'path';
3635
import { getEmailOnUserProfile } from './get-email-on-user-profile';
3736

3837
export class ManageMergeQueue extends HelperInputs {
@@ -68,8 +67,9 @@ export const manageMergeQueue = async ({
6867
if (slack_webhook_url && login) {
6968
const email = await getEmailOnUserProfile({ login, pattern });
7069
if (!email) {
70+
const patternText = pattern ? ` and must match the regex pattern \`${pattern}\`` : '';
7171
await createPrComment({
72-
body: `@${login} Your PR cannot be added to the queue because your email must be set correctly on your GitHub profile. Here are the steps to take:\n\n1. Go to ${join(context.serverUrl, login)}\n2. Click "Edit profile"\n3. Update your email address\n4. Click "Save"`
72+
body: `@${login} Your PR cannot be added to the queue because your email must be set on your GitHub profile${patternText}. Follow the instructions [here](${githubEmailDocsLink}) to add or fix your email.`
7373
});
7474
return removePrFromQueue(pullRequest);
7575
}
@@ -179,3 +179,6 @@ export const enableAutoMerge = async (pullRequestId: string, mergeMethod = 'SQUA
179179
core.warning(error as Error);
180180
}
181181
};
182+
183+
const githubEmailDocsLink =
184+
'https://docs.github.com/en/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-email-preferences/changing-your-primary-email-address';

0 commit comments

Comments
 (0)