Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion .github/actions/want-lgtm/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ inputs:
type: 'string'
required: false
default: '0.0.7'
ignore_bots:
description: 'Ignore approvals and review requests from bot accounts (logins ending in `[bot]`).'
type: 'boolean'
required: false
default: 'false'

runs:
using: 'composite'
Expand Down Expand Up @@ -49,6 +54,8 @@ runs:
name: 'Validate Reviews'
if: |-
${{ env.WANT_LGTM == 'all' }}
env:
IGNORE_BOTS: '${{ inputs.ignore_bots }}'
uses: 'actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea' # ratchet:actions/github-script@v7
with:
retries: 3
Expand All @@ -65,6 +72,7 @@ runs:
const reviewStateByLogin = {};
submittedReviews
.filter((r) => r.user.login !== context.payload.pull_request.user.login)
.filter((r) => process.env.IGNORE_BOTS === 'true' ? !r.user.login.endsWith('[bot]') : true)
.sort((a, b) => new Date(a.submitted_at) - new Date(b.submitted_at))
.forEach((r) => {
// add value if it doesnt not exist
Expand Down Expand Up @@ -107,7 +115,9 @@ runs:
pull_number: context.issue.number,
});

const pendingUserApprovals = requestedReviewers.users.map((u) => u.login);
const pendingUserApprovals = requestedReviewers.users
.filter((u) => process.env.IGNORE_BOTS === 'true' ? !u.login.endsWith('[bot]') : true)
.map((u) => u.login);
const pendingTeamApprovals = requestedReviewers.teams.map((t) => t.slug);

const pendingApprovals = [...pendingUserApprovals, ...pendingTeamApprovals];
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/want-lgtm-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ name: 'want-lgtm-all'

on:
workflow_call:
inputs:
ignore_bots:
description: 'Ignore approvals and review requests from bot accounts (logins ending in `[bot]`).'
required: false
type: 'boolean'
default: false

concurrency:
group: '${{ github.workflow }}-${{ github.head_ref || github.ref }}'
Expand All @@ -34,3 +40,5 @@ jobs:
steps:
- name: '[WANT_LGTM] Want LGTM Status'
uses: 'abcxyz/actions/.github/actions/want-lgtm@main' # ratchet:exclude
with:
ignore_bots: '${{ inputs.ignore_bots }}'
Loading