瀏覽代碼

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 <[email protected]>
Christian Marangi 2 年之前
父節點
當前提交
b67d284e93
共有 1 個文件被更改,包括 14 次插入0 次删除
  1. 14 0
      .github/workflows/labeler.yml

+ 14 - 0
.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/[email protected]
+        if: ${{ steps.check-branch.outputs.apply-tag }}
+        with:
+          token: ${{secrets.GITHUB_TOKEN}}
+          labels: ${{ github.base_ref }}
+          type: add