Skip to content

Commit

Permalink
Refine logic on when to run backport workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Widdis <[email protected]>
  • Loading branch information
dbwiddis committed Jan 6, 2025
1 parent c817981 commit 9a9143f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 0 additions & 1 deletion .github/workflows/add-backport-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ jobs:
- uses: actions-ecosystem/action-add-labels@v1
with:
labels: backport 2.x

10 changes: 9 additions & 1 deletion .github/workflows/backport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,15 @@ on:

jobs:
backport:
if: ${{ contains(github.event.label.name, 'backport') }}
if: >
github.event.pull_request.merged
&& (
github.event.action == 'closed'
|| (
github.event.action == 'labeled'
&& contains(github.event.label.name, 'backport')
)
)
runs-on: ubuntu-latest
permissions:
contents: write
Expand Down

0 comments on commit 9a9143f

Please sign in to comment.