CI: add support to tag pr targeting stable branch

Add support to tag pr targeting stable branch matching the simple regex
of openwrt-[0-9][0-9].[0-9][0-9]. The tag that will be added will match
the pr target branch.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
This commit is contained in:
Christian Marangi 2022-11-29 19:53:23 +01:00
parent 366bcffa0e
commit b67d284e93
No known key found for this signature in database
GPG Key ID: AC001D09ADBFEAD7
1 changed files with 14 additions and 0 deletions

View File

@ -17,3 +17,17 @@ jobs:
- uses: actions/labeler@v4
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
- 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
echo "apply-tag=yes" >> $GITHUB_OUTPUT
fi
- uses: buildsville/add-remove-label@v2.0.0
if: ${{ steps.check-branch.outputs.apply-tag }}
with:
token: ${{secrets.GITHUB_TOKEN}}
labels: ${{ github.base_ref }}
type: add