From 6fbef1e3f99ab72d138ba3091b173e82c2215790 Mon Sep 17 00:00:00 2001 From: Oleksiy Rudenko Date: Wed, 27 Jul 2022 16:08:18 +0200 Subject: [PATCH 1/2] entrypoint.sh: add support for pull_request_target --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index eadd404..cd1bcc3 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -20,7 +20,7 @@ end repo = event["repository"]["full_name"] -if ENV.fetch("GITHUB_EVENT_NAME") == "pull_request" +if ["pull_request", "pull_request_target"].include? ENV.fetch("GITHUB_EVENT_NAME") pr_number = event["number"] else pulls = github.pull_requests(repo, state: "open") From 12a37f974cfc8f6932cb5ecb124f5d0920733d1f Mon Sep 17 00:00:00 2001 From: OleksiyRudenko Date: Wed, 27 Jul 2022 16:31:26 +0200 Subject: [PATCH 2/2] docs: List pull_request_target among supported events --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 11934f2..4075379 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ A GitHub action that will comment on the relevant open PR with a file contents w - Requires the `GITHUB_TOKEN` secret. - Requires the comment's artifact in the `msg` parameter. -- Supports `push` and `pull_request` event types. +- Supports `push`, `pull_request` and `pull_request_target` event types. ### Sample workflow