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
17 changes: 13 additions & 4 deletions .github/workflows/auto-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,24 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Rewrite and post release notes to Discord
- name: Resolve previous tag
id: prev
if: steps.version.outputs.already_tagged != 'true' && env.DISCORD_DEV_WEBHOOK != ''
continue-on-error: true
run: |
VERSION="v${{ steps.version.outputs.version }}"
PREV_TAG=$(git tag --sort=-v:refname | grep -v "^${VERSION}$" | head -1)
node scripts/rewrite-release-notes.mjs "$VERSION" "$PREV_TAG" --post-discord
echo "tag=$PREV_TAG" >> $GITHUB_OUTPUT

- name: Rewrite and post release notes to Discord
if: steps.version.outputs.already_tagged != 'true' && env.DISCORD_DEV_WEBHOOK != ''
continue-on-error: true
uses: protoLabsAI/release-tools@v1
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Fetch the commit SHA for the v1 tag of protoLabsAI/release-tools
gh api repos/protoLabsAI/release-tools/git/ref/tags/v1 --jq '.object.sha'

Repository: protoLabsAI/protoMaker

Length of output: 107


Pin protoLabsAI/release-tools@v1 to a commit SHA in .github/workflows/auto-release.yml.

uses: protoLabsAI/release-tools@v1 is a mutable tag; pinning to the tag’s current commit reduces supply-chain risk.

🔒 Proposed fix
-        uses: protoLabsAI/release-tools@v1
+        uses: protoLabsAI/release-tools@79261c2b99472596cd5452e9ec1fd5c9648c12a6  # v1
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
uses: protoLabsAI/release-tools@v1
uses: protoLabsAI/release-tools@79261c2b99472596cd5452e9ec1fd5c9648c12a6 # v1
🧰 Tools
🪛 zizmor (1.25.2)

[error] 106-106: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/auto-release.yml at line 106, The workflow is using the
mutable tag protoLabsAI/release-tools@v1 which is a supply-chain risk; update
the step that currently says "uses: protoLabsAI/release-tools@v1" to pin to the
exact commit SHA for that v1 release (e.g.,
protoLabsAI/release-tools@<commit-sha>). Find the v1 branch/tag in the
protoLabsAI/release-tools repository, copy the commit SHA for the intended v1
release, and replace the mutable tag with that SHA so the action is pinned to a
specific immutable revision.

with:
version: v${{ steps.version.outputs.version }}
previous-version: ${{ steps.prev.outputs.tag }}
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
GATEWAY_API_KEY: ${{ secrets.GATEWAY_API_KEY }}
DISCORD_RELEASE_WEBHOOK: ${{ secrets.DISCORD_DEV_WEBHOOK }}

- name: Alert on release failure
if: failure() && steps.version.outputs.already_tagged != 'true'
Expand Down
20 changes: 10 additions & 10 deletions docs/internal/dev/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

## Overview

protoLabs Studio uses an LLM-powered release notes rewriter to transform raw conventional commit messages into polished, user-facing release notes. The system has two components:
protoLabs Studio uses an LLM-powered release notes rewriter to transform raw conventional commit messages into polished, user-facing release notes. Centralized in [`@protolabsai/release-tools`](https://github.com/protoLabsAI/release-tools):

1. **Prompt template** (`libs/prompts/src/release-notes.ts`) — reusable from any TypeScript context
2. **CLI script** (`scripts/rewrite-release-notes.mjs`) — standalone runner for CI or manual use
1. **Composite GitHub Action** (`protoLabsAI/release-tools@v1`) — used by `.github/workflows/auto-release.yml`
2. **npm CLI** (`npx @protolabsai/release-tools rewrite-release-notes`) — standalone runner for manual use

## How It Works

Expand Down Expand Up @@ -42,16 +42,16 @@ Raw commits like `feat(ui): wire file editor to upstream parity` become grouped,

```bash
# Auto-detect latest two tags
node scripts/rewrite-release-notes.mjs
npx @protolabsai/release-tools rewrite-release-notes

# Specify versions explicitly
node scripts/rewrite-release-notes.mjs v0.30.1 v0.29.0
npx @protolabsai/release-tools rewrite-release-notes v0.30.1 v0.29.0

# Preview the prompt without calling Claude
node scripts/rewrite-release-notes.mjs --dry-run
npx @protolabsai/release-tools rewrite-release-notes --dry-run

# Generate and post to Discord #dev
node scripts/rewrite-release-notes.mjs --post-discord
npx @protolabsai/release-tools rewrite-release-notes --post-discord
```

### Flags
Expand Down Expand Up @@ -124,7 +124,7 @@ The `auto-release.yml` workflow calls the rewriter script as the final step afte
run: |
VERSION="v${{ steps.version.outputs.version }}"
PREV_TAG=$(git tag --sort=-v:refname | grep -v "^${VERSION}$" | head -1)
node scripts/rewrite-release-notes.mjs "$VERSION" "$PREV_TAG" --post-discord
npx @protolabsai/release-tools rewrite-release-notes "$VERSION" "$PREV_TAG" --post-discord
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
```
Expand All @@ -133,9 +133,9 @@ The `auto-release.yml` workflow calls the rewriter script as the final step afte

- **Enabled by default**: Wired into `auto-release.yml` — runs on every push to `main`
- **Requires**: `ANTHROPIC_API_KEY` (Claude API)
- **Manual runs**: `node scripts/rewrite-release-notes.mjs` locally with `ANTHROPIC_API_KEY` set
- **Manual runs**: `npx @protolabsai/release-tools rewrite-release-notes` locally with `ANTHROPIC_API_KEY` set
- **Disable in CI**: Remove or comment out the "Rewrite and post release notes" step in `auto-release.yml`; the GitHub Release body still contains the raw auto-generated notes from `gh release create`

## Model Selection

The CLI script uses `claude-haiku-4-5-20251001` (Haiku 4.5) for speed and cost efficiency. Release notes rewriting is a structured text task that does not require Sonnet or Opus capabilities. To change the model, edit the `model` field in the `callClaude()` function in `scripts/rewrite-release-notes.mjs`.
Defaults to `protolabs/fast` via the protoLabs LLM gateway. Release notes rewriting is a structured text task that does not require a heavier model. To override, set the `model` input on the Action (e.g. `model: protolabs/smart`) or pass `--model <alias>` to the CLI. See [`@protolabsai/release-tools`](https://github.com/protoLabsAI/release-tools) for the full input/env reference.
4 changes: 2 additions & 2 deletions docs/internal/dev/versioning.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ Raw GitHub-generated release notes (which list PR titles) can be rewritten into

```bash
# Auto-detect tags and generate notes
node scripts/rewrite-release-notes.mjs
npx @protolabsai/release-tools rewrite-release-notes

# Specify versions + post to Discord
node scripts/rewrite-release-notes.mjs v0.30.1 v0.29.0 --post-discord
npx @protolabsai/release-tools rewrite-release-notes v0.30.1 v0.29.0 --post-discord
```

The rewriter filters out merge/chore/promote commits, sends the rest to Claude (Haiku 4.5), and returns themed sections grouped by user impact. The prompt template is also available programmatically via `@protolabsai/prompts`:
Expand Down
10 changes: 5 additions & 5 deletions docs/self-hosting/ci-cd.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ auto-release.yml

## Release Notes Rewriting

An LLM-powered release notes rewriter transforms raw conventional commits into polished, user-facing release notes. Available as both a reusable prompt template (`libs/prompts/src/release-notes.ts`) and a standalone CLI script (`scripts/rewrite-release-notes.mjs`).
An LLM-powered release notes rewriter transforms raw conventional commits into polished, user-facing release notes. Centralized in [`@protolabsai/release-tools`](https://github.com/protoLabsAI/release-tools) — exposed as both a composite GitHub Action (`protoLabsAI/release-tools@v1`) and an npm CLI (`npx @protolabsai/release-tools rewrite-release-notes`).

### How It Works

Expand All @@ -216,16 +216,16 @@ An LLM-powered release notes rewriter transforms raw conventional commits into p

```bash
# Auto-detect latest two tags
node scripts/rewrite-release-notes.mjs
npx @protolabsai/release-tools rewrite-release-notes

# Specify versions
node scripts/rewrite-release-notes.mjs v0.30.1 v0.29.0
npx @protolabsai/release-tools rewrite-release-notes v0.30.1 v0.29.0

# Preview prompt without calling API
node scripts/rewrite-release-notes.mjs --dry-run
npx @protolabsai/release-tools rewrite-release-notes --dry-run

# Generate and post to Discord
node scripts/rewrite-release-notes.mjs --post-discord
npx @protolabsai/release-tools rewrite-release-notes --post-discord
```

### CI Integration
Expand Down
210 changes: 0 additions & 210 deletions scripts/rewrite-release-notes.mjs

This file was deleted.

Loading