Skip to content

Commit 0eece4a

Browse files
authored
fix: Use github script to add comment (#132)
1 parent 80e0b42 commit 0eece4a

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

.github/workflows/upload-typedoc.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ jobs:
3333
generate-typedoc:
3434
runs-on: ubuntu-latest
3535
steps:
36-
- uses: actions/checkout@v6
36+
- uses: actions/checkout@v7
3737
with:
3838
fetch-depth: 0
3939

40-
- uses: actions/setup-node@v6
40+
- uses: actions/setup-node@v7
4141
with:
4242
node-version: lts/*
4343

@@ -85,20 +85,24 @@ jobs:
8585

8686
- name: Comment on PR
8787
if: github.event_name == 'pull_request' && steps.generate.outputs.success == 'true'
88-
uses: thollander/actions-comment-pull-request@24bffb9b452ba05a4f3f77933840a6a841d1b32b # v3
88+
uses: actions/github-script@v9
8989
with:
90-
comment-tag: "typedoc-result"
91-
message: |
92-
## 📚 TypeDoc Generation Result
90+
script: |
91+
github.rest.issues.createComment({
92+
issue_number: context.issue.number,
93+
owner: context.repo.owner,
94+
repo: context.repo.repo,
95+
body: `## 📚 TypeDoc Generation Result
9396
9497
✅ **TypeDoc generated successfully!**
9598
9699
- **File size:** ${{ steps.generate.outputs.file_size }}
97100
- **Total exports:** ${{ steps.generate.outputs.export_count }}
98-
- **Artifact:** `typedoc-${{ github.sha }}`
101+
- **Artifact:** \`typedoc-${{ github.sha }}\`
99102
- **HTML docs preview:** [Download artifact](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts/${{ steps.html-artifact.outputs.artifact-id }})
100103
101-
The TypeDoc JSON file has been generated and validated. All documentation scripts completed successfully.
104+
The TypeDoc JSON file has been generated and validated. All documentation scripts completed successfully.`
105+
})
102106
103107
- name: Extract version from tag
104108
if: (startsWith(github.ref, 'refs/tags/v') || github.event.inputs.upload == 'true') && steps.generate.outputs.success == 'true'

0 commit comments

Comments
 (0)