diff --git a/.github/workflows/milestone.yml b/.github/workflows/milestone.yml index 1897f2f617..7a4d483ee1 100644 --- a/.github/workflows/milestone.yml +++ b/.github/workflows/milestone.yml @@ -1,8 +1,11 @@ # Description: -# - Update milestone of a merged PR +# - Add milestone to a merged PR automatically +# - Add milestone to a closed issue that has a merged PR fix (if any) name: Milestone Action on: + issues: + types: [closed] pull_request_target: types: [closed] @@ -10,9 +13,18 @@ jobs: update-milestone: runs-on: ubuntu-latest name: Milestone Update - if: ${{github.event.pull_request.merged == true}} steps: - - name: Set Milestone + - name: Set Milestone for PR uses: hustcer/milestone-action@main + if: github.event.pull_request.merged == true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + # Bind milestone to closed issue that has a merged PR fix + - name: Set Milestone for Issue + uses: hustcer/milestone-action@main + if: github.event.issue.state == 'closed' + with: + action: bind-issue env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}