Skip to content

Commit

Permalink
Ignore GitHub bots in CLA check
Browse files Browse the repository at this point in the history
  • Loading branch information
rijkvanzanten committed Dec 7, 2023
1 parent de8776a commit 8747a57
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9590,7 +9590,9 @@ const missingAuthors = commits.data.filter((commit) => !commit.author?.login);
if (missingAuthors.length > 0) {
throw new Error(`PR contains commits without associated GitHub users`);
}
const authors = Array.from(new Set(commits.data.map((commit) => commit.author.login))).sort();
const authors = Array.from(new Set(commits.data
.filter((commit) => commit.author.type.toLowerCase() !== "bot")
.map((commit) => commit.author.login))).sort();
const fileContentResponse = await octokit.rest.repos.getContent({
owner: _actions_github__WEBPACK_IMPORTED_MODULE_1__.context.payload.pull_request.head.repo.owner.login,
repo: _actions_github__WEBPACK_IMPORTED_MODULE_1__.context.payload.pull_request.head.repo.name,
Expand Down
6 changes: 5 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ if (missingAuthors.length > 0) {
}

const authors = Array.from(
new Set(commits.data.map((commit) => commit.author!.login))
new Set(
commits.data
.filter((commit) => commit.author!.type.toLowerCase() !== "bot")
.map((commit) => commit.author!.login)
)
).sort();

const fileContentResponse = await octokit.rest.repos.getContent({
Expand Down

0 comments on commit 8747a57

Please sign in to comment.