|
5 | 5 | types: [opened, reopened, synchronize, labeled, unlabeled]
|
6 | 6 |
|
7 | 7 | permissions:
|
8 |
| - checks: write |
| 8 | + statuses: write |
9 | 9 |
|
10 | 10 | jobs:
|
11 | 11 | lint:
|
@@ -80,22 +80,24 @@ jobs:
|
80 | 80 | github.rest.repos.createCommitStatus({
|
81 | 81 | owner: context.repo.owner,
|
82 | 82 | repo: context.repo.repo,
|
83 |
| - sha: ${{ github.event.pull_request.head.sha }}, |
| 83 | + sha: context.sha, |
84 | 84 | state: 'success',
|
85 | 85 | context: 'pre-commit-result',
|
86 | 86 | description: 'All pre-commit checks passed',
|
87 | 87 | });
|
88 | 88 |
|
89 | 89 | - name: Report pending
|
90 |
| - env: |
91 |
| - GH_TOKEN: ${{ github.token }} |
92 | 90 | if: |
|
93 | 91 | !contains(github.event.pull_request.labels.*.name, 'Status: Pending Merge') ||
|
94 | 92 | needs.lint.result == 'failure'
|
95 |
| - run: | |
96 |
| - gh api \ |
97 |
| - --method POST \ |
98 |
| - -H "Accept: application/vnd.github+json" \ |
99 |
| - -H "X-GitHub-Api-Version: 2022-11-28" \ |
100 |
| - /repos/${{ github.repository }}/statuses/${{ github.sha }} \ |
101 |
| - -f state=pending -f context=pre-commit-result -f description="Pre-commit checks need to pass before merging" |
| 93 | + uses: actions/github-script@v7 |
| 94 | + with: |
| 95 | + script: | |
| 96 | + github.rest.repos.createCommitStatus({ |
| 97 | + owner: context.repo.owner, |
| 98 | + repo: context.repo.repo, |
| 99 | + sha: context.sha, |
| 100 | + state: 'pending', |
| 101 | + context: 'pre-commit-result', |
| 102 | + description: 'Pre-commit checks need to pass before merging', |
| 103 | + }); |
0 commit comments