Skip to content
This repository has been archived by the owner on Aug 25, 2024. It is now read-only.

ci: pr auto approve: Validate event sender #1638

Merged
merged 2 commits into from
Jul 12, 2024
Merged
Changes from 1 commit
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: 4 additions & 8 deletions .github/workflows/00_pr_auto_approve.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,11 @@ jobs:
}

approve-pr:
runs-on: ubuntu-latest
runs-on: ubuntu-latest q
johnandersen777 marked this conversation as resolved.
Show resolved Hide resolved
permissions:
pull-requests: write
# if: ${{ github.event_name == 'repository_dispatch' && contains(fromJson('["dependabot[bot]", "github-actions[bot]", "pdxjohnny"]'), github.event.actor) }}
if: github.event_name != 'pull_request_review'
if: ${{ github.event_name == 'repository_dispatch' && contains(fromJson('["github-actions[bot]", "pdxjohnny"]'), github.event.sender.login) && contains(fromJson('["dependabot[bot]", "github-actions[bot]", "pdxjohnny"]'), github.event.client_payload.actor) }}
steps:
- shell: cat -v {0}
run: ${{ toJSON(github.event) }}

- name: Harden Runner
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
with:
Expand All @@ -49,11 +45,11 @@ jobs:
- uses: hmarr/auto-approve-action@8f929096a962e83ccdfa8afcf855f39f12d4dac7 # v4
with:
review-message: "LGTM"
pull-request-number: ${{ github.event.pull_request.number }}
pull-request-number: ${{ github.event.client_payload.pull_request.number }}

- env:
GH_TOKEN: ${{ github.token }}
PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
PULL_REQUEST_NUMBER: ${{ github.event.client_payload.pull_request.number }}
run: |
set -x
gh pr merge --rebase "${PULL_REQUEST_NUMBER}"