From 9257df1456b5982ef893716eb624e03fd5d61483 Mon Sep 17 00:00:00 2001 From: exoego Date: Sun, 2 Jun 2024 09:05:24 +0900 Subject: [PATCH] If it is from a fork, run only on "pull_request_target" event --- .github/workflows/ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6a7a0ef..2032bed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,9 @@ on: - '*.md' pull_request: branches: [main] + pull_request_target: + branches: [main] + types: [opened, edited, synchronize, reopened] permissions: contents: read # for checkout repository @@ -16,6 +19,9 @@ jobs: build: runs-on: ubuntu-latest timeout-minutes: 5 + if: | + (github.event.pull_request.head.repo.fork == true && github.event_name == 'pull_request_target') || + (github.event.pull_request.head.repo.fork != true && github.event_name != 'pull_request_target') steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4