From 39689d9b3a32da06833f709e150a5c4cc15abe02 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Thu, 5 Nov 2020 14:38:21 +0100 Subject: [PATCH] ADD support for pull_request_target event --- .github/workflows/action-run.yml | 1 + .github/workflows/chromatic-action-test.yml | 2 +- .github/workflows/chromatic-action.yml | 2 +- .github/workflows/chromatic-staging-action.yml | 2 +- action/main.ts | 3 ++- 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/action-run.yml b/.github/workflows/action-run.yml index 4a95e6fb5..ecbd978d2 100755 --- a/.github/workflows/action-run.yml +++ b/.github/workflows/action-run.yml @@ -1,6 +1,7 @@ name: "self test development-like" on: pull_request: + pull_request_target: push: branches: - master diff --git a/.github/workflows/chromatic-action-test.yml b/.github/workflows/chromatic-action-test.yml index 7cd4afbf4..19e7524a2 100644 --- a/.github/workflows/chromatic-action-test.yml +++ b/.github/workflows/chromatic-action-test.yml @@ -1,5 +1,5 @@ name: "Chromatic via action-test" -on: [push, pull_request] +on: [push, pull_request, pull_request_target] jobs: chromatic: diff --git a/.github/workflows/chromatic-action.yml b/.github/workflows/chromatic-action.yml index ed9ff40b8..ac8745f86 100644 --- a/.github/workflows/chromatic-action.yml +++ b/.github/workflows/chromatic-action.yml @@ -1,5 +1,5 @@ name: "Chromatic via action" -on: [push, pull_request] +on: [push, pull_request, pull_request_target] jobs: chromatic: diff --git a/.github/workflows/chromatic-staging-action.yml b/.github/workflows/chromatic-staging-action.yml index 7e4af153c..6ee72aab5 100644 --- a/.github/workflows/chromatic-staging-action.yml +++ b/.github/workflows/chromatic-staging-action.yml @@ -1,5 +1,5 @@ name: "[Staging] Chromatic via action" -on: [push, pull_request] +on: [push, pull_request, pull_request_target] jobs: chromatic: diff --git a/action/main.ts b/action/main.ts index ca6d08d0f..4581d8846 100755 --- a/action/main.ts +++ b/action/main.ts @@ -23,7 +23,8 @@ const maybe = (a: string, b: any = undefined) => { const getCommit = (event: typeof context) => { switch (event.eventName) { - case 'pull_request': { + case 'pull_request': + case 'pull_request_target': { return { // @ts-ignore owner: event.payload.repository.owner.login,