2022-06-20 11:13:30 +00:00
|
|
|
name: 'Pull Request Labeler'
|
|
|
|
on:
|
|
|
|
- pull_request_target
|
|
|
|
|
2022-09-19 10:20:37 +00:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2022-06-20 11:13:30 +00:00
|
|
|
jobs:
|
|
|
|
labeler:
|
2022-09-19 10:20:37 +00:00
|
|
|
permissions:
|
|
|
|
contents: read # to determine modified files (actions/labeler)
|
|
|
|
pull-requests: write # to add labels to PRs (actions/labeler)
|
|
|
|
|
2022-06-20 11:13:30 +00:00
|
|
|
name: Pull Request Labeler
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2024-09-21 20:00:33 +00:00
|
|
|
- uses: actions/labeler@v5
|
2022-06-20 11:13:30 +00:00
|
|
|
with:
|
|
|
|
repo-token: '${{ secrets.GITHUB_TOKEN }}'
|
2022-11-29 18:53:23 +00:00
|
|
|
|
|
|
|
- name: Check Branch
|
|
|
|
id: check-branch
|
|
|
|
run: |
|
|
|
|
if echo "${{ github.base_ref }}" | grep -q -E 'openwrt-[0-9][0-9]\.[0-9][0-9]'; then
|
2022-12-01 00:46:03 +00:00
|
|
|
echo "release-tag=$(echo ${{ github.base_ref }} | sed 's/openwrt-/release\//')" >> $GITHUB_OUTPUT
|
2022-11-29 18:53:23 +00:00
|
|
|
fi
|
|
|
|
|
2024-09-21 20:00:33 +00:00
|
|
|
- uses: buildsville/add-remove-label@v2.0.1
|
2022-12-01 00:46:03 +00:00
|
|
|
if: ${{ steps.check-branch.outputs.release-tag }}
|
2022-11-29 18:53:23 +00:00
|
|
|
with:
|
|
|
|
token: ${{secrets.GITHUB_TOKEN}}
|
2022-12-01 00:46:03 +00:00
|
|
|
labels: ${{ steps.check-branch.outputs.release-tag }}
|
2022-11-29 18:53:23 +00:00
|
|
|
type: add
|