diff --git a/.github/workflows/add-license-header.yml b/.github/workflows/add-license-header.yml index 7555f8b74..f86c49b0f 100644 --- a/.github/workflows/add-license-header.yml +++ b/.github/workflows/add-license-header.yml @@ -15,12 +15,21 @@ jobs: permissions: contents: write pull-requests: write + issues: write # If you need to add labels or comments steps: + - name: Generate GitHub App Token + id: generate_token + uses: tibdex/github-app-token@v1 + with: + app_id: ${{ vars.GH_APP_ID }} + private_key: ${{ secrets.GH_APP_PRIVATE_KEY }} + - name: Checkout code uses: actions/checkout@v3 with: - fetch-depth: 0 # Important for creating branches and PRs + fetch-depth: 0 + token: ${{ steps.generate_token.outputs.token }} - name: Install Python (for running script) uses: actions/setup-python@v2 @@ -61,7 +70,7 @@ jobs: if: steps.changes.outputs.changes == 'true' uses: peter-evans/create-pull-request@v4 with: - token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ steps.generate_token.outputs.token }} commit-message: "Update license header in source files" branch: license-header-updates title: "Update License Headers"