]> code.ossystems Code Review - meta-freescale.git/commitdiff
cicd: backport: Fix events allowing the workflow to run 840/head
authorVinicius Aquino <vinicius.aquino@ossystems.com.br>
Mon, 9 Aug 2021 13:15:38 +0000 (10:15 -0300)
committerVinicius Aquino <vinicius.aquino@ossystems.com.br>
Mon, 9 Aug 2021 13:15:38 +0000 (10:15 -0300)
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>
.github/workflows/backport.yaml

index 54dce5bc093d3cf74972c70cc4079c172b0d2be9..cf3177704de466c03f5a3ed9cb0e109e0ded10fb 100644 (file)
@@ -2,23 +2,13 @@ name: Backport labeled merged pull requests
 on:
   pull_request_target:
     types: [closed]
-  issue_comment:
-    types: [created]
 jobs:
   build:
     name: Create backport PRs
     runs-on: ubuntu-latest
     # Only run when pull request is merged
     # or when a comment containing `/backport` is created
-    if: >
-      (
-        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')
-      )
+    if: github.event.pull_request.merged
     steps:
       - uses: actions/checkout@v2
         with: