Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jetersen committed Dec 14, 2021
1 parent 05a2418 commit 598d6ee
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ on:
- master
# pull_request event is required only for autolabeler
pull_request:
# pull_request_target event is required for autolabeler to support PRs from forks
# pull_request_target:
# Only following types are handled by the action, but one can default to all as well
types: [opened, reopened, synchronize]
# pull_request_target event is required for autolabeler to support PRs from forks
# pull_request_target:
# types: [opened, reopened, synchronize]

jobs:
update_release_draft:
Expand Down
6 changes: 5 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,11 @@ module.exports = (app, { getRouter }) => {
}
}
// check pr body
if (!found && autolabel.body.length > 0) {
if (
!found &&
context.payload.pull_request.body != null &&
autolabel.body.length > 0
) {
for (const matcher of autolabel.body) {
if (context.payload.pull_request.body.match(matcher)) {
labels.add(autolabel.label)
Expand Down
6 changes: 5 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,11 @@ module.exports = (app, { getRouter }) => {
}
}
// check pr body
if (!found && context.payload.pull_request.body != null && autolabel.body.length > 0) {
if (
!found &&
context.payload.pull_request.body != null &&
autolabel.body.length > 0
) {
for (const matcher of autolabel.body) {
if (context.payload.pull_request.body.match(matcher)) {
labels.add(autolabel.label)
Expand Down

0 comments on commit 598d6ee

Please sign in to comment.