Skip to content
Merged
Show file tree
Hide file tree
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
75 changes: 75 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Release

on:
push:
branches: [main]

# Least-privilege by default; jobs opt into the scopes they need.
permissions: {}

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false

jobs:
# Maintains the release PR and, when it is merged, tags + creates the
# GitHub releases for every package whose changelog changed.
release-please:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
outputs:
releases_created: ${{ steps.release.outputs.releases_created }}
paths_released: ${{ steps.release.outputs.paths_released }}
steps:
- uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5.0.0
id: release
with:
config-file: release-please-config.json
manifest-file: .release-please-manifest.json

# Builds and publishes only the packages that were just released to npm.
publish:
needs: release-please
if: ${{ needs.release-please.outputs.releases_created == 'true' }}
runs-on: ubuntu-latest
permissions:
contents: read
# OIDC token for npm Trusted Publishing — no NPM_TOKEN needed. npm also
# generates a provenance attestation automatically on trusted publishes.
id-token: write
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3

# Installs the tool versions pinned in mise.toml (bun + node, which
# provides the npm CLI used to publish).
- uses: jdx/mise-action@1648a7812b9aeae629881980618f079932869151 # v4.0.1

- name: Install dependencies
run: bun install --frozen-lockfile

- name: Build
run: bun run build

# Trusted Publishing (OIDC) requires npm >= 11.5.1; the npm bundled with
# node 22 is 10.x, so upgrade it before publishing.
- name: Upgrade npm for Trusted Publishing
run: npm install -g npm@latest

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: npm@latest makes the release job non-reproducible and can cause sudden publish failures when npm releases new versions.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/release.yml, line 58:

<comment>`npm@latest` makes the release job non-reproducible and can cause sudden publish failures when npm releases new versions.</comment>

<file context>
@@ -0,0 +1,75 @@
+      # Trusted Publishing (OIDC) requires npm >= 11.5.1; the npm bundled with
+      # node 22 is 10.x, so upgrade it before publishing.
+      - name: Upgrade npm for Trusted Publishing
+        run: npm install -g npm@latest
+
+      - name: Publish released packages
</file context>
Suggested change
run: npm install -g npm@latest
run: npm install -g npm@11.5.1


- name: Publish released packages
env:
# release-please emits the dirs it released as a JSON array, e.g.
# ["packages/asana","packages/emulate"].
PATHS_RELEASED: ${{ needs.release-please.outputs.paths_released }}
run: |
echo "$PATHS_RELEASED" | jq -r '.[]' | while read -r pkg; do
echo "::group::publish $pkg"
# `bun pm pack` rewrites `workspace:*` deps to the concrete version
# in the tarball (npm pack/publish on its own would not). npm then
# publishes that tarball, authenticating via OIDC (Trusted Publisher
# configured on npmjs.com) and attaching provenance automatically.
tarball="$(cd "$pkg" && bun pm pack --quiet)"
npm publish "$pkg/$tarball" --access public
Comment on lines +72 to +73

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 MEDIUM RISK

The npm publish command is missing the --provenance flag required to generate attestations. Additionally, the script should explicitly verify that the tarball was created to avoid falling back to publishing the source directory with un-resolved workspace dependencies. Suggested fix: Update the publish loop in .github/workflows/release.yml to verify the existence of the $tarball before publishing and add the --provenance flag to the npm publish command.

echo "::endgroup::"
done
10 changes: 10 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"packages/asana": "0.1.0",
"packages/emulate": "0.1.0",
"packages/firebase": "0.1.0",
"packages/kakao": "0.1.0",
"packages/linear": "0.1.0",
"packages/naver": "0.1.0",
"packages/supabase": "0.1.0",
"packages/toss-payments": "0.1.0"
}
3 changes: 3 additions & 0 deletions packages/emulate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@
"bin": {
"emulate": "./dist/index.js"
},
"publishConfig": {
"access": "public"
},
"files": [
"dist"
],
Expand Down
19 changes: 19 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"release-type": "node",
"include-component-in-tag": true,
"separate-pull-requests": false,
"plugins": [
"node-workspace"
],
"packages": {
"packages/asana": {},
"packages/emulate": {},
"packages/firebase": {},
"packages/kakao": {},
"packages/linear": {},
"packages/naver": {},
"packages/supabase": {},
"packages/toss-payments": {}
}
}