From 3e60c2a58a66c82a2e6135743b94d015d06c0346 Mon Sep 17 00:00:00 2001 From: "ocmbot[bot]" <125909804+ocmbot[bot]@users.noreply.github.com> Date: Fri, 31 Jan 2025 17:12:59 +0000 Subject: [PATCH] chore: add set milestone action --- .github/workflows/milestone.yaml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 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 000000000..9137df0b3 --- /dev/null +++ b/.github/workflows/milestone.yaml @@ -0,0 +1,26 @@ +name: Set milestone +on: + issues: + types: + - closed + pull_request: + types: + - closed +jobs: + set_milestone: + name: Set milestone + runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write + steps: + - name: Set milestone on issue + if: github.event.issue.state_reason == 'completed' + run: gh issue edit ${{ github.event.issue.number }} --milestone "$(date +"%Y-Q%q")" --repo ${{ github.repository }} + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Set milestone on pull request + if: github.event.pull_request.merged == true + run: gh pr edit ${{ github.event.pull_request.number }} --milestone "$(date +"%Y-Q%q")" --repo ${{ github.repository }} + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}