Skip to content

Commit

Permalink
add warning
Browse files Browse the repository at this point in the history
  • Loading branch information
danadajian committed Jan 10, 2025
1 parent a606151 commit 43632f4
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 4 deletions.
3 changes: 3 additions & 0 deletions dist/284.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/284.index.js.map

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions dist/862.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/862.index.js.map

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

3 changes: 3 additions & 0 deletions dist/946.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/946.index.js.map

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion src/helpers/get-email-on-user-profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ limitations under the License.

import { HelperInputs } from '../types/generated';
import { octokit } from '../octokit';
import { setFailed } from '@actions/core';
import { setFailed, warning } from '@actions/core';

export class GetEmailOnUserProfile extends HelperInputs {
login = '';
Expand All @@ -25,6 +25,10 @@ export const getEmailOnUserProfile = async ({ login, pattern }: GetEmailOnUserPr
data: { email }
} = await octokit.users.getByUsername({ username: login });

if (!email) {
warning(`User ${login} does not have an email address on their GitHub profile!`);
}

if (pattern && email && !new RegExp(pattern).test(email)) {
setFailed(
`Email ${email} does not match regex pattern ${pattern}. Please update the email on your GitHub profile to match this pattern!`
Expand Down

0 comments on commit 43632f4

Please sign in to comment.