Skip to content

Commit

Permalink
chore: add set milestone action (#1288)
Browse files Browse the repository at this point in the history
See [#401 - Automatically set milestone at issues when
closed](open-component-model/ocm-project#401)
for more information. Now with reuse of central managed action.

Co-authored-by: ocmbot[bot] <125909804+ocmbot[bot]@users.noreply.github.com>
  • Loading branch information
ocmbot[bot] authored Feb 7, 2025
1 parent 258ecdf commit e77996e
Showing 1 changed file with 6 additions and 22 deletions.
28 changes: 6 additions & 22 deletions .github/workflows/milestone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +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: Generate token
id: generate_token
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.OCMBOT_APP_ID }}
private_key: ${{ secrets.OCMBOT_PRIV_KEY }}
- 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: ${{ steps.generate_token.outputs.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: ${{ steps.generate_token.outputs.token }} # For PRs and branch protection the standard GITHUB_TOKEN is not sufficient
pull-requests: write

0 comments on commit e77996e

Please sign in to comment.