Skip to content

Commit

Permalink
fix: pull_request_target should be included in remove labels operatio…
Browse files Browse the repository at this point in the history
…ns (#76)

* pull_request_target should be included in remove labels operations

* added build
  • Loading branch information
fuxingloh authored Apr 18, 2021
1 parent 7e4378c commit 1d6d95d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
6 changes: 5 additions & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions src/labeler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ import files from './matcher/files'
import author from './matcher/author'
import * as github from '@actions/github'

/**
* @param {string[]} labels that are newly derived
* @param {Config} config of the labels
*/
export function mergeLabels(labels: string[], config: Config): string[] {
const context = github.context
const payload = context.payload.pull_request || context.payload.issue
Expand Down
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ async function removeLabels(
config: Config
): Promise<unknown[]> {
const eventName = github.context.eventName
if (!['pull_request', 'issue'].includes(eventName)) {
if (!['pull_request', 'pull_request_target', 'issue'].includes(eventName)) {
return []
}

Expand Down

0 comments on commit 1d6d95d

Please sign in to comment.