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
77 changes: 0 additions & 77 deletions .github/workflows/ci.yml

This file was deleted.

41 changes: 41 additions & 0 deletions .github/workflows/pr-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: CI - PR Validation

on:
pull_request:
branches: [develop]

permissions:
contents: read

jobs:
validate:
name: CI - PR Validation
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm

- name: Install
run: npm ci

- name: Format (check)
run: npm run format

- name: Lint
run: npm run lint

- name: Typecheck
run: npm run typecheck

- name: Test
run: npm test

- name: Build
run: npm run build
33 changes: 15 additions & 18 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,44 @@
# Publish to npm - Runs on version tags
name: Publish to npm
name: Publish to NPM

on:
push:
tags:
- "v*.*.*"
branches:
- master
workflow_dispatch:

jobs:
publish:
name: Build & Publish
runs-on: ubuntu-latest

permissions:
contents: read
id-token: write
packages: write

steps:
- name: Checkout
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
node-version: "20"
registry-url: "https://registry.npmjs.org"
cache: "npm"

- name: Install dependencies
run: npm ci

- name: Run lint
run: npm run lint
- name: Run lint (if present)
run: npm run lint --if-present
continue-on-error: false

- name: Run tests
run: npm test
- name: Run tests (if present)
run: npm test --if-present
continue-on-error: false

- name: Build package
run: npm run build

- name: Verify package contents
run: npm pack --dry-run

- name: Publish to npm
run: npm publish --provenance --access public
- name: Publish to NPM
run: npm publish --access public
Comment on lines +41 to +42
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

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

The publish workflow dropped --provenance (and no longer requests id-token: write), which reduces supply-chain integrity for npm releases. If this wasn’t intentional, consider restoring provenance publishing and the required OIDC permission.

Copilot uses AI. Check for mistakes.
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
83 changes: 83 additions & 0 deletions .github/workflows/release-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: CI - Release Check

on:
pull_request:
branches: [master]
workflow_dispatch:
inputs:
sonar:
description: "Run SonarCloud analysis"
required: true
default: "false"
type: choice
options:
- "false"
- "true"

concurrency:
group: ci-release-${{ github.ref }}
cancel-in-progress: true

jobs:
ci:
name: release checks
runs-on: ubuntu-latest
timeout-minutes: 25

# Config stays in the workflow file (token stays in repo secrets)
env:
SONAR_HOST_URL: "https://sonarcloud.io"
SONAR_ORGANIZATION: "ciscode"
SONAR_PROJECT_KEY: "CISCODE-MA_DatabaseKit"

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "22"
cache: "npm"

- name: Install
run: npm ci

- name: Format
run: npm run format

- name: Typecheck
run: npm run typecheck

- name: Lint
run: npm run lint

- name: Test (with coverage)
run: npm run test:cov

- name: Build
run: npm run build

- name: SonarCloud Scan
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.sonar == 'true' }}
uses: SonarSource/sonarqube-scan-action@v6
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ env.SONAR_HOST_URL }}
with:
args: >
-Dsonar.organization=${{ env.SONAR_ORGANIZATION }} \
-Dsonar.projectKey=${{ env.SONAR_PROJECT_KEY }} \
-Dsonar.sources=src \
-Dsonar.tests=test \
-Dsonar.javascript.lcov.reportPaths=coverage/lcov.info

- name: SonarCloud Quality Gate
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.sonar == 'true' }}
uses: SonarSource/sonarqube-quality-gate-action@v1
timeout-minutes: 10
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ env.SONAR_HOST_URL }}
1 change: 1 addition & 0 deletions .husky/_/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*
2 changes: 2 additions & 0 deletions .husky/_/applypatch-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env sh
. "$(dirname "$0")/h"
2 changes: 2 additions & 0 deletions .husky/_/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env sh
. "$(dirname "$0")/h"
22 changes: 22 additions & 0 deletions .husky/_/h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env sh
[ "$HUSKY" = "2" ] && set -x
n=$(basename "$0")
s=$(dirname "$(dirname "$0")")/$n

[ ! -f "$s" ] && exit 0

if [ -f "$HOME/.huskyrc" ]; then
echo "husky - '~/.huskyrc' is DEPRECATED, please move your code to ~/.config/husky/init.sh"
fi
i="${XDG_CONFIG_HOME:-$HOME/.config}/husky/init.sh"
[ -f "$i" ] && . "$i"

[ "${HUSKY-}" = "0" ] && exit 0

export PATH="node_modules/.bin:$PATH"
sh -e "$s" "$@"
c=$?

[ $c != 0 ] && echo "husky - $n script failed (code $c)"
[ $c = 127 ] && echo "husky - command not found in PATH=$PATH"
exit $c
9 changes: 9 additions & 0 deletions .husky/_/husky.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
echo "husky - DEPRECATED
Please remove the following two lines from $0:
#!/usr/bin/env sh
. \"\$(dirname -- \"\$0\")/_/husky.sh\"
They WILL FAIL in v10.0.0
"
Comment on lines +1 to +9
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

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

The added Husky bootstrap file (_/husky.sh) contains only an echo deprecation notice (and no initialization logic), which means hooks that source it won’t set up PATH / execution behavior as Husky expects. This should either be replaced with Husky’s generated husky.sh for the installed version, or (preferred for Husky v9) hooks should source _/h instead and husky.sh can be removed.

Suggested change
echo "husky - DEPRECATED
Please remove the following two lines from $0:
#!/usr/bin/env sh
. \"\$(dirname -- \"\$0\")/_/husky.sh\"
They WILL FAIL in v10.0.0
"
#!/usr/bin/env sh
# Husky bootstrap script
# Initializes environment and delegates execution to .husky/_/h
if [ -z "$husky_skip_init" ]; then
# Enable debug output when HUSKY_DEBUG=1
debug () {
[ "$HUSKY_DEBUG" = "1" ] && echo "husky (debug) - $1"
}
readonly hook_name="$(basename -- "$0")"
debug "starting $hook_name..."
# Allow disabling Husky by setting HUSKY=0
if [ "$HUSKY" = "0" ]; then
debug "HUSKY env variable is set to 0, skipping hook"
exit 0
fi
# Skip if not in a project with package.json
if [ ! -f package.json ]; then
debug "no package.json, skipping hook"
exit 0
fi
# Husky runner
command=".husky/_/h"
if [ ! -f "$command" ]; then
debug "can't find husky runner at $command, skipping hook"
exit 0
fi
if [ ! -x "$command" ]; then
debug "husky runner is not executable, skipping hook"
exit 0
fi
export husky_skip_init=1
sh -e "$command" "$hook_name" "$@"
exitCode="$?"
if [ "$exitCode" != 0 ]; then
echo "husky - $hook_name hook exited with code $exitCode (error)"
fi
exit "$exitCode"
fi

Copilot uses AI. Check for mistakes.
2 changes: 2 additions & 0 deletions .husky/_/post-applypatch
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env sh
. "$(dirname "$0")/h"
2 changes: 2 additions & 0 deletions .husky/_/post-checkout
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env sh
. "$(dirname "$0")/h"
2 changes: 2 additions & 0 deletions .husky/_/post-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env sh
. "$(dirname "$0")/h"
2 changes: 2 additions & 0 deletions .husky/_/post-merge
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env sh
. "$(dirname "$0")/h"
2 changes: 2 additions & 0 deletions .husky/_/post-rewrite
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env sh
. "$(dirname "$0")/h"
2 changes: 2 additions & 0 deletions .husky/_/pre-applypatch
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env sh
. "$(dirname "$0")/h"
2 changes: 2 additions & 0 deletions .husky/_/pre-auto-gc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env sh
. "$(dirname "$0")/h"
2 changes: 2 additions & 0 deletions .husky/_/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env sh
. "$(dirname "$0")/h"
2 changes: 2 additions & 0 deletions .husky/_/pre-merge-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env sh
. "$(dirname "$0")/h"
2 changes: 2 additions & 0 deletions .husky/_/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env sh
. "$(dirname "$0")/h"
2 changes: 2 additions & 0 deletions .husky/_/pre-rebase
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env sh
. "$(dirname "$0")/h"
2 changes: 2 additions & 0 deletions .husky/_/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env sh
. "$(dirname "$0")/h"
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

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

The pre-commit hook runs npx lint-staged, but the repo doesn't include a lint-staged dependency or any lint-staged configuration (package.json / .lintstagedrc). As-is, this hook will typically fail for contributors (or attempt an implicit network install). Add lint-staged to devDependencies and provide config, or replace this hook with explicit commands (e.g., npm run format / npm run lint) if lint-staged isn't intended.

Suggested change
npx lint-staged
npm run lint

Copilot uses AI. Check for mistakes.
2 changes: 2 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
npm run typecheck
npm test
Loading