From afd92f887efe9615f8c66a069a24aae06729c0a9 Mon Sep 17 00:00:00 2001 From: bubkoo Date: Thu, 5 Nov 2020 14:17:56 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E2=9C=A8=20support=20pull=5Frequest=5F?= =?UTF-8?q?target?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/action.ts | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index e5467eb..51591a1 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "auto-assign", "description": "A Github Action to add reviewers/assignees to pull requests when pull requests are opened.", - "version": "1.0.0", + "version": "1.0.1", "main": "dist/index.js", "repository": "https://github.com/bubkoo/auto-assign", "author": "bubkoo ", diff --git a/src/action.ts b/src/action.ts index 7a11269..f00adb4 100644 --- a/src/action.ts +++ b/src/action.ts @@ -8,10 +8,14 @@ export namespace Action { try { const context = github.context const payload = context.payload.pull_request || context.payload.issue + core.debug(`event: ${context.eventName}`) + core.debug(`action: ${context.payload.action}`) + if ( payload && - (Util.isValidEvent('pull_request', 'opened') || - Util.isValidEvent('issues', 'opened')) + (Util.isValidEvent('issues', 'opened') || + Util.isValidEvent('pull_request', 'opened') || + Util.isValidEvent('pull_request_target', 'opened')) ) { if (context.payload.pull_request) { if (payload.draft) {