cicd: Use pull_request_target instead of pull_request

When a PR comes from a forked repo, use pull_request_target as event
type instead of pull_request.

Signed-off-by: Vinicius Aquino <vinicius.aquino@ossystems.com.br>
This commit is contained in:
Vinicius Aquino 2021-07-06 17:07:16 -03:00
parent 35acd10426
commit 20f7b80f3f

View File

@ -1,6 +1,6 @@
name: Backport labeled merged pull requests name: Backport labeled merged pull requests
on: on:
pull_request: pull_request_target:
types: [closed] types: [closed]
issue_comment: issue_comment:
types: [created] types: [created]
@ -12,11 +12,11 @@ jobs:
# or when a comment containing `/backport` is created # or when a comment containing `/backport` is created
if: > if: >
( (
github.event_name == 'pull_request' && github.event_name == 'pull_request_target' &&
github.event.pull_request.merged github.event.pull_request_target.merged
) || ( ) || (
github.event_name == 'issue_comment' && github.event_name == 'issue_comment' &&
github.event.issue.pull_request && github.event.issue.pull_request_target &&
contains(github.event.comment.body, '/backport') contains(github.event.comment.body, '/backport')
) )
steps: steps: