Skip to content

Commit

Permalink
feat: ✨ support pull_request_target
Browse files Browse the repository at this point in the history
  • Loading branch information
bubkoo committed Nov 5, 2020
1 parent 2f2f141 commit afd92f8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>",
Expand Down
8 changes: 6 additions & 2 deletions src/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit afd92f8

Please sign in to comment.