From ef6a77e94cb0ba4a7b7f68756572e6371c780fb2 Mon Sep 17 00:00:00 2001 From: "ocmbot[bot]" <125909804+ocmbot[bot]@users.noreply.github.com> Date: Fri, 7 Feb 2025 12:39:23 +0100 Subject: [PATCH] chore: add set milestone action (#183) See [#401 - Automatically set milestone at issues when closed](https://github.com/open-component-model/ocm-project/issues/401) for more information. Now with reuse of central managed action. Co-authored-by: ocmbot[bot] <125909804+ocmbot[bot]@users.noreply.github.com> --- .github/workflows/milestone.yaml | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/.github/workflows/milestone.yaml b/.github/workflows/milestone.yaml index 9137df0..b678383 100644 --- a/.github/workflows/milestone.yaml +++ b/.github/workflows/milestone.yaml @@ -2,25 +2,15 @@ name: Set milestone on: issues: types: - - closed + - closed pull_request: types: - - closed + - closed + jobs: set_milestone: - name: Set milestone - runs-on: ubuntu-latest + uses: open-component-model/.github/.github/workflows/milestone.yml@main + secrets: inherit 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 }} + pull-requests: write