Update pr-auto-comment.yml #7
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: Auto Comment on Pull Request | |
| on: | |
| pull_request_target: | |
| types: [opened] | |
| jobs: | |
| add-comment: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| issues: write | |
| pull-requests: write | |
| steps: | |
| - name: Generate a token | |
| id: generate-token | |
| uses: actions/create-github-app-token@v2 | |
| with: | |
| app-id: ${{ secrets.APP_ID }} | |
| private-key: ${{ secrets.APP_PRIVATE_KEY }} | |
| - name: Add comment | |
| uses: actions/github-script@v7 | |
| with: | |
| github-token: ${{ steps.generate-token.outputs.token }} | |
| script: | | |
| const { repo: { owner, repo } } = context; | |
| github.rest.issues.createComment({ | |
| owner, | |
| repo, | |
| issue_number: ${{ github.event.pull_request.number }}, | |
| body: 'Please add "/azp run" comment to your PR to trigger pull request validation' | |
| }); |