Skip to content

Commit

Permalink
Auto label target/<branch> for PR. Fixes infinispan#13222
Browse files Browse the repository at this point in the history
  • Loading branch information
rigazilla authored and pruivo committed Dec 9, 2024
1 parent 503177e commit 2b3c27f
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/pull_request_open.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,21 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PROJECT_KEY: ISPN
TOKEN: ${{ secrets.JIRA_API_TOKEN }}

targetlabel:
runs-on: ubuntu-latest
steps:
- name: Get Labels Action
run: |
labels=$(gh api repos/${GH_REPO}/labels -q 'map(.name)')
echo "LABELS=$labels" >> $GITHUB_ENV
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
- if: ${{ contains(fromJSON(env.LABELS), env.TARGET) }}
run: |
gh pr edit ${{ github.event.pull_request.number }} --add-label ${TARGET}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
TARGET: target/${{ github.event.pull_request.base.ref }}

0 comments on commit 2b3c27f

Please sign in to comment.