Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: PR Commenter (Secure App) | |
| on: [pull_request] | |
| # do not request perms for the standard token. it stays ro | |
| permissions: {} | |
| jobs: | |
| comment: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # 1. create Token using the GitHub App | |
| - name: Generate GitHub App Token | |
| id: generate_token | |
| uses: actions/create-github-app-token@v1 | |
| with: | |
| app-id: ${{ secrets.COMMENTER_APP_ID }} | |
| private-key: ${{ secrets.COMMENTER_APP_PRIVATE_KEY }} | |
| # 2. use token to comment | |
| - name: Post comment | |
| uses: actions/github-script@v7 | |
| with: | |
| github-token: ${{ steps.generate_token.outputs.token }} | |
| script: | | |
| github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number, | |
| body: 'my comment' | |
| }) |