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
1 change: 1 addition & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
tar -tzf "$TARBALL" | grep -q "package/dist/index.js"
mkdir -p /tmp/wizard-smoke
npm install --prefix /tmp/wizard-smoke "$PWD/$TARBALL"
# exits non-zero when invoked without config — that's expected; we only verify the bin is executable
/tmp/wizard-smoke/node_modules/.bin/coval-wizard 2>&1 || true
rm -f "$TARBALL"

Expand Down
17 changes: 11 additions & 6 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ name: Auto Release
on:
push:
branches: [main]
workflow_dispatch: # manual dry-run: detects bump type without creating a release

permissions:
contents: write

concurrency:
group: auto-release
group: auto-release-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: false

jobs:
Expand All @@ -28,7 +29,7 @@ jobs:

if [ -z "$LAST_TAG" ]; then
COMMITS=$(git log --format="%s")
BASE_VERSION=$(node -p "require('./package.json').version")
BASE_VERSION=$(jq -r '.version' package.json)

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 | 🟡 Minor

Add error handling for jq extraction.

If package.json is missing or malformed, jq -r '.version' returns null or fails silently, leaving BASE_VERSION invalid. This causes cryptic failures downstream in version computation.

Proposed fix
-            BASE_VERSION=$(jq -r '.version' package.json)
+            BASE_VERSION=$(jq -r '.version // empty' package.json)
+            if [ -z "$BASE_VERSION" ]; then
+              echo "::error::Failed to read version from package.json"
+              exit 1
+            fi
📝 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
BASE_VERSION=$(jq -r '.version' package.json)
BASE_VERSION=$(jq -r '.version // empty' package.json)
if [ -z "$BASE_VERSION" ]; then
echo "::error::Failed to read version from package.json"
exit 1
fi
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/release-please.yml at line 32, The BASE_VERSION assignment
using jq can yield null or an empty string if package.json is missing/malformed;
update the release-please.yml step that sets BASE_VERSION to capture jq's exit
status and validate its output (e.g., run jq -r '.version' package.json into a
variable, check for non-zero exit code and that BASE_VERSION is not empty and
not "null"), and if validation fails, print a clear error and exit non‑zero so
downstream version computation cannot proceed with an invalid BASE_VERSION.

else
COMMITS=$(git log --format="%s" "${LAST_TAG}..HEAD")
BASE_VERSION="${LAST_TAG#v}"
Expand All @@ -43,11 +44,14 @@ jobs:
while IFS= read -r msg; do
# Strip [LINEAR-XXX] / [SIM-123] style prefixes
clean=$(echo "$msg" | sed 's/^\[[A-Za-z]*-[0-9]*\] //')
if [[ "$clean" =~ ^[a-z]+(\([^)]*\))?!: ]]; then
re_major='^[a-z]+(\([^)]*\))?!:'
re_feat='^feat(\([^)]*\))?:'
re_fix='^(fix|perf)(\([^)]*\))?:'
if [[ "$clean" =~ $re_major ]]; then
TYPE="major"; break
elif [[ "$clean" =~ ^feat(\([^)]*\))?: ]] && [[ "$TYPE" != "major" ]]; then
elif [[ "$clean" =~ $re_feat ]] && [[ "$TYPE" != "major" ]]; then
TYPE="minor"
elif [[ "$clean" =~ ^(fix|perf)(\([^)]*\))?: ]] && [[ "$TYPE" == "none" ]]; then
elif [[ "$clean" =~ $re_fix ]] && [[ "$TYPE" == "none" ]]; then
TYPE="patch"
fi
done <<< "$COMMITS"
Expand All @@ -64,12 +68,13 @@ jobs:
major) V="$((M+1)).0.0" ;;
minor) V="$M.$((N+1)).0" ;;
patch) V="$M.$N.$((P+1))" ;;
*) echo "Unexpected bump type: ${{ steps.release.outputs.type }}"; exit 1 ;;
esac
echo "value=$V" >> "$GITHUB_OUTPUT"
echo "tag=v$V" >> "$GITHUB_OUTPUT"

- name: Create GitHub release
if: steps.release.outputs.type != 'none'
if: steps.release.outputs.type != 'none' && github.event_name == 'push'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Releases are fully automatic on every merge to `main`. No manual version bumps o
|---|---|---|
| `feat:` | minor (`1.x.0`) | `feat: add gemini support` |
| `fix:` / `perf:` | patch (`1.0.x`) | `fix: handle 403 as invalid key` |
| `feat!:` / `fix!:` | major (`x.0.0`) | `feat!: redesign CLI interface` |
| `feat!:` / `fix!:` | major (`x.0.0`) | `feat!: redesign CLI` |
| `chore:` / `ci:` / `docs:` | no release | — |

2. **Linear ticket prefixes are stripped automatically.** A PR titled `[SIM-123] feat: add something` is treated identically to `feat: add something`.
Expand Down