Repository navigation
feat(astro): deploy live demo to GitHub Pages with iframe bridge - #45
PaarthPandey10 wants to merge 1 commit into
Conversation
Kusari Analysis Results:
No pinned version dependency changes, code issues or exposed secrets detected! Note View full detailed analysis result for more information on the output and the checks that were run.
Found this helpful? Give it a 👍 or 👎 reaction! |
|
|
||
| permissions: | ||
| contents: read | ||
| pages: write |
There was a problem hiding this comment.
Issue: pages: write is granted at workflow level, so the build job gets it too even though only the deploy job needs it. Keep the top-level permissions at contents: read and move pages: write to the deploy job.
Recommended Code Changes:
permissions:
contents: read
jobs:
deploy:
permissions:
pages: write
id-token: write
| permissions: | ||
| contents: read | ||
| pages: write | ||
| id-token: write |
There was a problem hiding this comment.
Issue: id-token: write is granted at workflow level, so the build job, which runs npm install and build scripts, can mint OIDC tokens. Scope it to the deploy job only.
Recommended Code Changes:
permissions:
contents: read
jobs:
deploy:
permissions:
pages: write
id-token: write
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout gemara-react | ||
| uses: actions/checkout@v4 |
There was a problem hiding this comment.
Issue: Pin this action to a full commit SHA instead of the mutable v4 tag. Also set persist-credentials: false so the GITHUB_TOKEN is not left in .git/config while later npm scripts run.
Recommended Code Changes:
uses: actions/checkout@<full-commit-SHA> # v4
with:
path: gemara-react
persist-credentials: false
| run: echo "ref=$(cat .spec-version)" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Checkout gemara fixtures | ||
| uses: actions/checkout@v4 |
There was a problem hiding this comment.
Issue: Pin this action to a full commit SHA and set persist-credentials: false. This checkout only needs read access to fixtures.
Recommended Code Changes:
uses: actions/checkout@<full-commit-SHA> # v4
with:
repository: gemaraproj/gemara
ref: ${{ steps.spec.outputs.ref }}
path: gemara
persist-credentials: false
| path: gemara | ||
|
|
||
| - name: Setup Node | ||
| uses: actions/setup-node@v4 |
There was a problem hiding this comment.
Issue: Pin this action to a full commit SHA instead of the mutable v4 tag.
Recommended Code Changes:
uses: actions/setup-node@<full-commit-SHA> # v4
| run: npm run build | ||
|
|
||
| - name: Setup Pages | ||
| uses: actions/configure-pages@v5 |
There was a problem hiding this comment.
Issue: Pin this action to a full commit SHA instead of the mutable v5 tag.
Recommended Code Changes:
uses: actions/configure-pages@<full-commit-SHA> # v5
| uses: actions/configure-pages@v5 | ||
|
|
||
| - name: Upload Pages artifact | ||
| uses: actions/upload-pages-artifact@v3 |
There was a problem hiding this comment.
Issue: Pin this action to a full commit SHA instead of the mutable v3 tag.
Recommended Code Changes:
uses: actions/upload-pages-artifact@<full-commit-SHA> # v3
| steps: | ||
| - name: Deploy to GitHub Pages | ||
| id: deployment | ||
| uses: actions/deploy-pages@v4 No newline at end of file |
There was a problem hiding this comment.
Issue: Pin this action to a full commit SHA. This job holds pages: write and id-token: write, so a compromised tag here is high impact.
Recommended Code Changes:
uses: actions/deploy-pages@<full-commit-SHA> # v4
Signed-off-by: PaarthPandey10 <paarthdxb@gmail.com>
faccf43 to
052b739
Compare
|
Kusari PR Analysis rerun based on - 052b739 performed at: 2026-11-05T07:08:58Z - link to updated analysis |
Related to gemaraproj/website#6 and gemaraproj/website#52
Summary
Configures the
examples/astroshowcase for GitHub Pages deployment (https://gemaraproj.github.io/gemara-react/) and adds a lightweightpostMessagebridge so it can be embedded directly in the documentation website (gemaraproj/website#52) without adding a Node toolchain to the website repo.Changes
examples/astro/astro.config.mjs: Setsite: "https://gemaraproj.github.io"andbase: "/gemara-react/"so static asset paths resolve cleanly on GitHub Pages.examples/astro/src/pages/index.astro:data-gemara-*attribute contract matching the Gemara documentation site palette.postMessagebridge that emitsgemara-readyon load, postsgemara-resizeupdates viaResizeObserver, and listens forgemara-theme(light/dark) from the parent documentation page.examples/astro/package.json: Made thea11yscript cross-platform sopa11y-ciruns on both Linux and Windows..github/workflows/pages.yml: Added a GitHub Pages deployment workflow that checks out the siblinggemaraspec test fixtures, builds@gemara/react, buildsexamples/astro, and deploysexamples/astro/distto GitHub Pages on pushes tomain.