Skip to content

Commit 6143ec6

Browse files
authored
Use status instead of checks for docusaurus build (#42)
1 parent f6f9701 commit 6143ec6

File tree

1 file changed

+15
-17
lines changed

1 file changed

+15
-17
lines changed

.github/workflows/docusaurus-build.yml

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,22 @@ on:
66
pull_request:
77
branches: [ main ]
88

9+
permissions:
10+
statuses: write
11+
contents: read
12+
913
jobs:
1014
build:
1115
name: Build Docusaurus Site
1216
runs-on: ubuntu-latest
1317

1418
steps:
15-
- uses: actions/checkout@v3
19+
- uses: actions/checkout@v4
1620

1721
- name: Setup Node.js
18-
uses: actions/setup-node@v3
22+
uses: actions/setup-node@v4
1923
with:
20-
node-version: '18'
24+
node-version: '20'
2125
cache: 'npm'
2226

2327
- name: Install dependencies
@@ -26,23 +30,17 @@ jobs:
2630
- name: Build site
2731
run: npm run build
2832

29-
- name: Update PR Status
33+
- name: Update Status
3034
if: github.event_name == 'pull_request'
31-
uses: actions/github-script@v6
35+
uses: actions/github-script@v7
3236
with:
3337
script: |
34-
const { owner, repo, number } = context.issue;
3538
const { sha } = context.payload.pull_request.head;
3639
37-
await github.rest.checks.create({
38-
owner,
39-
repo,
40-
name: 'Docusaurus Build',
41-
head_sha: sha,
42-
status: 'completed',
43-
conclusion: 'success',
44-
output: {
45-
title: 'Build Successful',
46-
summary: 'The Docusaurus site built successfully'
47-
}
40+
await github.rest.repos.createCommitStatus({
41+
...context.repo,
42+
sha: sha,
43+
state: 'success',
44+
description: 'Docusaurus site built successfully',
45+
context: 'Docusaurus Build'
4846
});

0 commit comments

Comments
 (0)