From c84fefc4ea7e10c7e990ad0fa558e2d06a793c12 Mon Sep 17 00:00:00 2001 From: hustcer Date: Sun, 29 Dec 2024 12:09:28 +0800 Subject: [PATCH] chore: Add milestone workflow to add milestone to merged PR and fixed Issues --- .github/workflows/milestone.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/milestone.yml diff --git a/.github/workflows/milestone.yml b/.github/workflows/milestone.yml new file mode 100644 index 0000000000..9ac5536ffc --- /dev/null +++ b/.github/workflows/milestone.yml @@ -0,0 +1,32 @@ +# Description: +# - 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] + +jobs: + update-milestone: + runs-on: namespace-profile-ghostty-sm + name: Milestone Update + steps: + - name: Set Milestone for PR + uses: hustcer/milestone-action@v2 + if: github.event.pull_request.merged == true + with: + action: bind-pr # `bind-pr` is the default action + 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@v2 + if: github.event.issue.state == 'closed' + with: + action: bind-issue + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}