Skip to content

Commit edcac4e

Browse files
committed
Test
1 parent 8dfb56b commit edcac4e

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

.github/workflows/pre-commit.yml

+13-11
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
types: [opened, reopened, synchronize, labeled, unlabeled]
66

77
permissions:
8-
checks: write
8+
statuses: write
99

1010
jobs:
1111
lint:
@@ -80,22 +80,24 @@ jobs:
8080
github.rest.repos.createCommitStatus({
8181
owner: context.repo.owner,
8282
repo: context.repo.repo,
83-
sha: ${{ github.event.pull_request.head.sha }},
83+
sha: context.sha,
8484
state: 'success',
8585
context: 'pre-commit-result',
8686
description: 'All pre-commit checks passed',
8787
});
8888
8989
- name: Report pending
90-
env:
91-
GH_TOKEN: ${{ github.token }}
9290
if: |
9391
!contains(github.event.pull_request.labels.*.name, 'Status: Pending Merge') ||
9492
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

Comments
 (0)