Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ on:
jobs:
test:
runs-on: ubuntu-latest
permissions:
contents: read

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good — Scoped permissions on the test job follow least privilege.

steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -37,12 +39,18 @@ jobs:
publish:
needs: test
runs-on: ubuntu-latest
permissions:
contents: write

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 nit — contents: write is unneeded — the push uses the SSH deploy key and npm publish uses NPM_TOKEN; contents: read suffices.

steps:
# The repo ruleset requires PRs for GITHUB_TOKEN pushes to main.
# Checking out with the repo Deploy Key (SSH) makes the version-bump
# push below bypass the ruleset, same as api/console/chat release.yml.
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: main

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 nit — publish always checks out main while test runs on the dispatch ref, so dispatching from a branch publishes main code that was never tested.

ssh-key: ${{ secrets.DEPLOY_KEY }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 warning — Deliberate ruleset bypass via a write deploy key makes DEPLOY_KEY a standing direct-push credential for anyone who can dispatch this workflow; keep it repo-scoped/rotated or use a GitHub App as an explicit bypass actor.


- name: Setup Node.js
uses: actions/setup-node@v4
Expand Down
Loading