diff --git a/.github/workflows/milestone-on-tag.yml b/.github/workflows/milestone-on-tag.yml new file mode 100644 index 00000000..0df1cf25 --- /dev/null +++ b/.github/workflows/milestone-on-tag.yml @@ -0,0 +1,23 @@ +on: + pull_request: + types: [labeled, unlabeled] + +jobs: + add-milestone: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Check if tag is a valid version + uses: actions-ecosystem/action-regex-match@v2 + id: regex-match + with: + text: ${{ github.event.label.name }} + regex: 'v[0-9]+?\.[0-9]+?\.[0-9]+?' + + - name: Assign a milestone to pull requests + uses: zoispag/action-assign-milestone@v2.1.0 + if: ${{ steps.regex-match.outputs.match != '' }} + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" + milestone: "${{ steps.regex-match.outputs.match }}"