Skip to content

fix: use app token because of PR / branch protection #13

fix: use app token because of PR / branch protection

fix: use app token because of PR / branch protection #13

Workflow file for this run

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: 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