Skip to content

Commit

Permalink
TASK: Remove label if target has changed
Browse files Browse the repository at this point in the history
  • Loading branch information
markusguenther committed Feb 19, 2023
1 parent ba17130 commit 8c729ea
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/add-pr-labels.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
name: Add Labels to Pull Request

on:
pull_request_target:
types: [opened, reopened, synchronize]
pull_request:
types: [opened, reopened]
types: [opened, reopened, synchronize]

jobs:
add-labels:
runs-on: ubuntu-latest
steps:
- name: Add target branch label
uses: actions-ecosystem/action-add-labels@v1
- name: Checkout
uses: actions/checkout@v2
- name: Remove all labels
uses: rogerluan/[email protected]
with:
labels: ${{ github.event.pull_request.base.ref }}
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Add feature label
if: startsWith(github.event.pull_request.title, 'FEATURE:')
uses: actions-ecosystem/action-add-labels@v1
Expand All @@ -27,5 +31,9 @@ jobs:
uses: actions-ecosystem/action-add-labels@v1
with:
labels: 'task'
- name: Add target branch label
uses: actions-ecosystem/action-add-labels@v1
with:
labels: ${{ github.base_ref }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 8c729ea

Please sign in to comment.