This GitHub Action automatically posts a download link for documentation artifacts on Pull Requests. It utilizes nightly.link to provide direct access to build outputs without requiring users to navigate the Actions UI.
- 🔗 Automatic Linking: Generates direct download links for artifacts.
- 🔄 Smart Updates: Updates existing comments to minimize PR clutter.
- 🎨 Customizable: Modify headers, artifact names, and link labels.
Add this action to a workflow triggered by workflow_run.
on:
workflow_run:
workflows: [Build Docs]
types: [completed]
jobs:
comment:
if: github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: HaoZeke/doc-previewer@v1
with:
workflow_run_id: ${{ github.event.workflow_run.id }}
head_sha: ${{ github.event.workflow_run.head_sha }}
artifact_name: simulation-report
comment_header: '### Documentation Preview'This includes contains the following scripts:
build- Build for productionrelease- Generate changelog and npm publishlint- Checks your code for any linting errorstest- Run all teststest:watch- Run all tests with watch modetest:coverage- Run all tests with code coverage reporttypecheck- Run TypeScript type checkingprepare- Script for setting up husky hooks
MIT.