Skip to content

[CI] Reviewer Lottery: Use contains() in if rule (backport #401) #228

[CI] Reviewer Lottery: Use contains() in if rule (backport #401)

[CI] Reviewer Lottery: Use contains() in if rule (backport #401) #228

name: Reviewer lottery
on:
pull_request_target:
types: [opened, ready_for_review, reopened]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: |
echo "$GITHUB_CONTEXT"
echo "The GitHub Actor's username is: $GITHUB_ACTOR"
reviewer-lottery:
runs-on: ubuntu-latest
if: ${{ ! contains(fromJSON('["dependabot[bot]", "mergify[bot]"]'), github.actor) }}
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: |
echo "$GITHUB_CONTEXT"
echo "The GitHub Actor's username is: $GITHUB_ACTOR"
- uses: actions/checkout@v4
- uses: uesteibar/reviewer-lottery@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}