|
1 | 1 | name: Check if commit message body is not too short |
2 | 2 |
|
3 | 3 | on: |
| 4 | + pull_request_target: |
| 5 | + types: [opened, synchronize, edited, reopened] |
4 | 6 | pull_request: |
5 | 7 | types: [opened, synchronize, edited, reopened] |
6 | 8 |
|
| 9 | +permissions: {} |
| 10 | + |
7 | 11 | jobs: |
8 | 12 | verify-body-length: |
9 | 13 | runs-on: ubuntu-latest |
10 | 14 | # set as non-voting for now. |
11 | 15 | continue-on-error: true |
12 | 16 |
|
13 | | - permissions: |
14 | | - contents: write |
15 | | - pull-requests: write |
16 | | - repository-projects: write |
17 | | - |
18 | 17 | steps: |
19 | 18 | - name: Checkout repository |
20 | 19 | uses: actions/checkout@v4 |
21 | 20 | with: |
22 | 21 | fetch-depth: 0 |
23 | 22 |
|
| 23 | + - name: Generate GitHub App Token |
| 24 | + id: generate_token |
| 25 | + uses: actions/create-github-app-token@v2 |
| 26 | + with: |
| 27 | + app-id: ${{ secrets.COMMENTER_APP_ID }} |
| 28 | + private-key: ${{ secrets.COMMENTER_APP_PRIVATE_KEY }} |
| 29 | + owner: ${{ github.repository_owner }} |
| 30 | + repositories: | |
| 31 | + ci-framework |
| 32 | +
|
| 33 | + - name: Post comment |
| 34 | + uses: actions/github-script@v7 |
| 35 | + with: |
| 36 | + github-token: ${{ steps.generate_token.outputs.token }} |
| 37 | + script: | |
| 38 | + github.rest.issues.createComment({ |
| 39 | + owner: context.repo.owner, |
| 40 | + repo: context.repo.repo, |
| 41 | + issue_number: context.issue.number, |
| 42 | + body: 'my comment' |
| 43 | + }) |
| 44 | +
|
24 | 45 | - name: Dump commit message to file |
25 | 46 | run: | |
26 | 47 | git fetch origin ${{ github.event.pull_request.head.sha }} |
|
42 | 63 | issue-number: ${{ github.event.pull_request.number }} |
43 | 64 | body-path: ./result.log |
44 | 65 | reactions: confused |
| 66 | + token: ${{ steps.generate_token.outputs.token }} |
0 commit comments