From 22f67f870488225cceb42615d799ebd9be7ac250 Mon Sep 17 00:00:00 2001 From: hustcer Date: Tue, 5 Nov 2024 18:42:35 +0800 Subject: [PATCH] chore: Add milestone action --- .github/workflows/milestone.yaml | 34 ++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/milestone.yaml diff --git a/.github/workflows/milestone.yaml b/.github/workflows/milestone.yaml new file mode 100644 index 00000000..14a101f --- /dev/null +++ b/.github/workflows/milestone.yaml @@ -0,0 +1,34 @@ +# Description: +# - Add milestone to a merged PR or closed issue. + +name: Milestone Action +on: + issues: + types: [closed] + pull_request_target: + types: [closed] + +# Fix GraphQL: Resource not accessible by integration (updatePullRequest) +permissions: + contents: write + pull-requests: write + +jobs: + update-milestone: + runs-on: ubuntu-latest + name: Milestone Update + steps: + - name: Set Milestone for PR + uses: hustcer/milestone-action@main + if: github.event.pull_request.merged == true + with: + action: bind-pr + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - 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 }}