Skip to content

Commit

Permalink
cicd: backport: Fix events allowing the workflow to run
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Ossanes committed Aug 9, 2021
1 parent 80669e3 commit 60a283e
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions .github/workflows/backport.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 60a283e

Please sign in to comment.