mirror of
https://github.com/Freescale/meta-freescale-3rdparty.git
synced 2025-07-19 12:09:01 +02:00
cicd: backport: Fix events allowing the workflow to run
Even when using pull_request_target, the merged is issued as pull_request and this should be used to ensure we can run the workflow. Signed-off-by: Vinicius Aquino <vinicius.aquino@ossystems.com.br>
This commit is contained in:
parent
0d6dac1ee5
commit
485a417afd
12
.github/workflows/backport.yaml
vendored
12
.github/workflows/backport.yaml
vendored
|
@ -2,23 +2,13 @@ name: Backport labeled merged pull requests
|
||||||
on:
|
on:
|
||||||
pull_request_target:
|
pull_request_target:
|
||||||
types: [closed]
|
types: [closed]
|
||||||
issue_comment:
|
|
||||||
types: [created]
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: Create backport PRs
|
name: Create backport PRs
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
# Only run when pull request is merged
|
# Only run when pull request is merged
|
||||||
# or when a comment containing `/backport` is created
|
# or when a comment containing `/backport` is created
|
||||||
if: >
|
if: github.event.pull_request.merged
|
||||||
(
|
|
||||||
github.event_name == 'pull_request_target' &&
|
|
||||||
github.event.pull_request_target.merged
|
|
||||||
) || (
|
|
||||||
github.event_name == 'issue_comment' &&
|
|
||||||
github.event.issue.pull_request_target &&
|
|
||||||
contains(github.event.comment.body, '/backport')
|
|
||||||
)
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user