From: Christian Marangi Date: Tue, 29 Nov 2022 18:53:23 +0000 (+0100) Subject: CI: add support to tag pr targeting stable branch X-Git-Tag: v22.03.3~121 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=e516c31e148b2b83961b096fc0e205d363e65efd;p=openwrt%2Fstaging%2Fpepe2k.git 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. (cherry picked from commit b67d284e93ee052e3ea3abb5d3dae55723ce0353) Signed-off-by: Christian Marangi --- diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index b67265ca80..62a895a68b 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -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