Skip to content

Commit

Permalink
Restore pull_request event
Browse files Browse the repository at this point in the history
  • Loading branch information
chuckwondo committed Sep 17, 2024
1 parent 1f43fb4 commit 98ba9bb
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 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 @@ -30,22 +31,22 @@ jobs:

steps:
- 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
# will need to make sure the PR looks safe, and if so, manually re-run the
# failed actions.
# failed jobs.
run: |
echo "User ${{ github.triggering_actor }} does not have permission to run integration tests."
echo "Current permission level is ${{ steps.permission.outputs.user-permission }}."
echo "Job originally triggered by ${{ github.actor }}."
echo "A maintainer must perform a security review and re-run this build, if the code is safe."
exit 1
- name: Checkout source
uses: actions/checkout@v4
Expand All @@ -55,7 +56,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Get full python version
id: full-python-version
run: echo version=$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))") >> $GITHUB_OUTPUT
run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")
- name: Install poetry
uses: abatilo/actions-poetry@v3
- name: Configure poetry
Expand All @@ -74,12 +75,12 @@ jobs:
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
- name: Install Dependencies
if: ${{ !env.ACT }}
run: poetry install --quiet --extras kerchunk
run: poetry install
- name: Install Dependencies
if: ${{ env.ACT }}
# When using `act` to run the workflow locally, the `poetry install` command
# may fail due to network issues when running multiple Docker containers.
run: poetry install --quiet --extras kerchunk || poetry install --quiet --extras kerchunk || poetry install --quiet --extras kerchunk
run: poetry install || poetry install || poetry install
- name: Test
env:
EARTHDATA_USERNAME: ${{ secrets.EDL_USERNAME }}
Expand Down

0 comments on commit 98ba9bb

Please sign in to comment.