-
Notifications
You must be signed in to change notification settings - Fork 2
ci(publish): bypass main ruleset via deploy key for version-bump push #85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,6 +15,8 @@ on: | |
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
@@ -37,12 +39,18 @@ jobs: | |
| publish: | ||
| needs: test | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 }} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
|
||
There was a problem hiding this comment.
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.