Skip to content

Commit

Permalink
Add back pull_request action
Browse files Browse the repository at this point in the history
  • Loading branch information
chuckwondo committed Sep 17, 2024
1 parent 2ccf1a6 commit fa49692
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Integration Tests

on:
pull_request:
pull_request_target:
types:
- opened
Expand Down Expand Up @@ -34,14 +35,18 @@ jobs:
fail-fast: false

steps:
- name: Checkout source
if: ${{ github.event_name != 'pull_request_target' }}
uses: actions/checkout@v4
- name: Fetch user permission
if: ${{ github.event_name == 'pull_request_target' }}
id: permission
uses: actions-cool/check-user-permission@v2
with:
require: write
username: ${{ github.triggering_actor }}
- name: Check user permission
if: steps.permission.outputs.require-result == 'false'
if: ${{ github.event_name == 'pull_request_target' && steps.permission.outputs.require-result == 'false' }}
# If the triggering actor does not have write permission (i.e., this is a
# PR from a fork), then we exit, otherwise most of the integration tests will
# fail because they require access to secrets. In this case, a maintainer
Expand All @@ -52,10 +57,7 @@ jobs:
echo "A maintainer must perform a security review and re-run this build, if the code is safe."
exit 1
- name: Checkout source
if: ${{ github.event_name == 'push' }}
uses: actions/checkout@v4
- name: Checkout source
if: ${{ github.event_name != 'push' }}
if: ${{ github.event_name == 'pull_request_target' }}
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
Expand Down

0 comments on commit fa49692

Please sign in to comment.