From e69cfd352ecb13d1d3a0be0968d55dc03d9893c1 Mon Sep 17 00:00:00 2001 From: lastlink Date: Mon, 9 Feb 2026 16:41:43 -0500 Subject: [PATCH 1/2] fix foreign key generation --- .github/dependabot.yml | 7 +- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/publish.yaml | 80 +++- .github/workflows/tests.yaml | 93 ++++- .gitignore | 1 + GitVersion.yml | 52 +++ package.json | 2 +- .../convert-npm-audit-outdated-to-sonar.js | 80 ++++ scripts/generateVersion.ps1 | 57 +++ scripts/generateVersion.sh | 84 ++++ scripts/updateVersion.ps1 | 65 +++ scripts/updateVersion.sh | 98 +++++ src/index.ts | 36 +- tests/data/results/ToModel.json | 384 +++++++++++++++--- 14 files changed, 953 insertions(+), 88 deletions(-) create mode 100644 GitVersion.yml create mode 100644 scripts/convert-npm-audit-outdated-to-sonar.js create mode 100644 scripts/generateVersion.ps1 create mode 100644 scripts/generateVersion.sh create mode 100644 scripts/updateVersion.ps1 create mode 100644 scripts/updateVersion.sh diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 539359c..82f820e 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -9,4 +9,9 @@ updates: directory: "/" # Location of package manifests schedule: interval: "weekly" - + open-pull-requests-limit: 10 + labels: + - "dependencies" + - "npm" + rebase-strategy: "auto" + diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index a6694b5..79a8f53 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -32,7 +32,7 @@ jobs: strategy: fail-fast: false matrix: - language: [ 'javascript' ] + language: [ 'javascript', 'typescript' ] # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 9956035..9c03b81 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -3,11 +3,89 @@ on: release: types: [created] +env: + retention_days: 3 + jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # Fetch full git history for version calculation + + - name: Install GitVersion + uses: gittools/actions/gitversion/setup@v4.1.0 + with: + versionSpec: "6.3.x" + + - name: Determine Version + id: version_step # step id used as a reference for output values + uses: gittools/actions/gitversion/execute@v4.1.0 + env: + DOTNET_GITVERSION_TELEMETRY_OPTOUT: 1 + with: + configFilePath: ./GitVersion.yml + + - name: Extract version information + id: extract-version + run: | + # Read GitVersion output and replace PullRequest with Patch + VERSION="${{ steps.version_step.outputs.SemVer }}" + # make 0.1.0-PullRequest99.190 to 0.1.0-Patch99.190 + VERSION=$(echo "$VERSION" | sed 's/PullRequest/Patch/g') + FULL_SEMVER="${{ steps.version_step.outputs.FullSemVer }}" + MAJOR_MINOR_PATCH="${{ steps.version_step.outputs.MajorMinorPatch }}" + GIT_HASH="${{ steps.version_step.outputs.Sha }}" + GIT_TAG="${{ steps.version_step.outputs.PreReleaseTag }}" + GIT_BRANCH="${{ steps.version_step.outputs.BranchName }}" + COMMIT_COUNT="${{ steps.version_step.outputs.CommitsSinceVersionSource }}" + BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") + + # Create version.txt content + cat > version-$VERSION.txt << EOF + version=$VERSION + major_minor_patch=$MAJOR_MINOR_PATCH + full_semver=$FULL_SEMVER + git_hash=$GIT_HASH + git_tag=$GIT_TAG + git_branch=$GIT_BRANCH + commit_count=$COMMIT_COUNT + build_date=$BUILD_DATE + EOF + + # Output version for other steps + echo "VERSION=$VERSION" >> $GITHUB_OUTPUT + echo "MAJOR_MINOR_PATCH=$MAJOR_MINOR_PATCH" >> $GITHUB_OUTPUT + echo "FULL_SEMVER=$FULL_SEMVER" >> $GITHUB_OUTPUT + echo "GIT_HASH=$GIT_HASH" >> $GITHUB_OUTPUT + echo "GIT_TAG=$GIT_TAG" >> $GITHUB_OUTPUT + echo "GIT_BRANCH=$GIT_BRANCH" >> $GITHUB_OUTPUT + echo "COMMIT_COUNT=$COMMIT_COUNT" >> $GITHUB_OUTPUT + + # Display version info + echo "Generated version: $VERSION" + echo "Major minor patch: $MAJOR_MINOR_PATCH" + echo "Full semver: $FULL_SEMVER" + echo "Git hash: $GIT_HASH" + echo "Git branch: $GIT_BRANCH" + echo "Commit count: $COMMIT_COUNT" + echo "Build date: $BUILD_DATE" + echo "version.txt content:" + cat version-$VERSION.txt + + - name: Update project files with version + run: | + chmod +x scripts/updateVersion.sh + bash scripts/updateVersion.sh + + - name: Upload version.txt as artifact + uses: actions/upload-artifact@v4 + continue-on-error: true + with: + name: version-info + path: version-${{ steps.extract-version.outputs.VERSION }}.txt + retention-days: ${{ env.retention_days }} # Setup .npmrc file to publish to npm - uses: actions/setup-node@v3 with: diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 5a7a8de..10367fe 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -7,11 +7,89 @@ on: - main pull_request: +env: + retention_days: 3 + jobs: tests: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # Fetch full git history for version calculation + + - name: Install GitVersion + uses: gittools/actions/gitversion/setup@v4.1.0 + with: + versionSpec: "6.3.x" + + - name: Determine Version + id: version_step # step id used as a reference for output values + uses: gittools/actions/gitversion/execute@v4.1.0 + env: + DOTNET_GITVERSION_TELEMETRY_OPTOUT: 1 + with: + configFilePath: ./GitVersion.yml + + - name: Extract version information + id: extract-version + run: | + # Read GitVersion output and replace PullRequest with Patch + VERSION="${{ steps.version_step.outputs.SemVer }}" + # make 0.1.0-PullRequest99.190 to 0.1.0-Patch99.190 + VERSION=$(echo "$VERSION" | sed 's/PullRequest/Patch/g') + FULL_SEMVER="${{ steps.version_step.outputs.FullSemVer }}" + MAJOR_MINOR_PATCH="${{ steps.version_step.outputs.MajorMinorPatch }}" + GIT_HASH="${{ steps.version_step.outputs.Sha }}" + GIT_TAG="${{ steps.version_step.outputs.PreReleaseTag }}" + GIT_BRANCH="${{ steps.version_step.outputs.BranchName }}" + COMMIT_COUNT="${{ steps.version_step.outputs.CommitsSinceVersionSource }}" + BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") + + # Create version.txt content + cat > version-$VERSION.txt << EOF + version=$VERSION + major_minor_patch=$MAJOR_MINOR_PATCH + full_semver=$FULL_SEMVER + git_hash=$GIT_HASH + git_tag=$GIT_TAG + git_branch=$GIT_BRANCH + commit_count=$COMMIT_COUNT + build_date=$BUILD_DATE + EOF + + # Output version for other steps + echo "VERSION=$VERSION" >> $GITHUB_OUTPUT + echo "MAJOR_MINOR_PATCH=$MAJOR_MINOR_PATCH" >> $GITHUB_OUTPUT + echo "FULL_SEMVER=$FULL_SEMVER" >> $GITHUB_OUTPUT + echo "GIT_HASH=$GIT_HASH" >> $GITHUB_OUTPUT + echo "GIT_TAG=$GIT_TAG" >> $GITHUB_OUTPUT + echo "GIT_BRANCH=$GIT_BRANCH" >> $GITHUB_OUTPUT + echo "COMMIT_COUNT=$COMMIT_COUNT" >> $GITHUB_OUTPUT + + # Display version info + echo "Generated version: $VERSION" + echo "Major minor patch: $MAJOR_MINOR_PATCH" + echo "Full semver: $FULL_SEMVER" + echo "Git hash: $GIT_HASH" + echo "Git branch: $GIT_BRANCH" + echo "Commit count: $COMMIT_COUNT" + echo "Build date: $BUILD_DATE" + echo "version.txt content:" + cat version-$VERSION.txt + + - name: Update project files with version + run: | + chmod +x scripts/updateVersion.sh + bash scripts/updateVersion.sh + + - name: Upload version.txt as artifact + uses: actions/upload-artifact@v4 + continue-on-error: true + with: + name: version-info + path: version-${{ steps.extract-version.outputs.VERSION }}.txt + retention-days: ${{ env.retention_days }} - uses: actions/setup-node@v3 with: node-version: current @@ -46,3 +124,16 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} clover-file: ./coverage/clover.xml + + automerge: + needs: tests + name: Auto-merge PR if tests pass + if: (github.actor == 'dependabot[bot]' || github.actor == 'imgbot[bot]') && needs.tests.result == 'success' + runs-on: ubuntu-latest + steps: + - name: Merge PR + uses: peter-evans/enable-pull-request-automerge@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + merge-method: squash + pull-request-number: ${{ github.event.pull_request.number }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index ca378b3..b3eb5b4 100644 --- a/.gitignore +++ b/.gitignore @@ -108,3 +108,4 @@ samples/output.md junit.xml output-*.json funktechno-sqlsimpleparser* +version*txt diff --git a/GitVersion.yml b/GitVersion.yml new file mode 100644 index 0000000..7a5adcb --- /dev/null +++ b/GitVersion.yml @@ -0,0 +1,52 @@ +workflow: TrunkBased/preview1 + +mode: ContinuousDelivery +assembly-versioning-scheme: MajorMinorPatch +assembly-file-versioning-scheme: MajorMinorPatch +semantic-version-format: Strict +commit-message-incrementing: Enabled + +branches: + main: + regex: ^main$ + increment: Patch + is-main-branch: true + is-release-branch: true + prevent-increment: + of-merged-branch: true + track-merge-target: true + track-merge-message: true + + dev: + regex: ^dev$ + increment: None + mode: ContinuousDelivery + label: alpha + prevent-increment: + of-merged-branch: true + track-merge-message: true + source-branches: + - main + + # builds directly off feature/ branches + feature: + regex: ^features?[/-](?.+) + increment: None + label: "beta{BranchName}" + track-merge-message: true + source-branches: + - main + - dev + + pull-request: + regex: ^(pull|pull-requests|pr)[/-](?\d+) + increment: None + mode: ContinuousDelivery + label: zeta{Number} + prevent-increment: + of-merged-branch: true + track-merge-message: true + source-branches: + - main + - dev + - feature diff --git a/package.json b/package.json index 3f0fa4e..ca0bf89 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@funktechno/sqlsimpleparser", - "version": "0.1.0", + "version": "0.1.1", "description": "", "main": "lib/index.js", "types": "lib/index.d.ts", diff --git a/scripts/convert-npm-audit-outdated-to-sonar.js b/scripts/convert-npm-audit-outdated-to-sonar.js new file mode 100644 index 0000000..ddbf721 --- /dev/null +++ b/scripts/convert-npm-audit-outdated-to-sonar.js @@ -0,0 +1,80 @@ +// convert-npm-audit-outdated-to-sonar.js +import fs from "node:fs"; + +// Load npm audit and outdated reports +const audit = JSON.parse(fs.readFileSync("npm-audit.json", "utf8")); +const outdated = JSON.parse(fs.readFileSync("npm-outdated.json", "utf8")); + +const issues = []; + +// Convert npm audit vulnerabilities +for (const vuln of Object.values(audit.vulnerabilities || {})) { + // Normalize ruleId: prefer CVE/advisory ID if available, else package name + let ruleId = vuln.name; + if (Array.isArray(vuln.via) && vuln.via.length > 0) { + const via = vuln.via[0]; + if (typeof via === "string") { + ruleId = via; + } else if (via && typeof via === "object") { + // advisory id or source if present + ruleId = via.source || via.url || via.title || vuln.name; + } + } + + issues.push({ + engineId: "npm-audit", + ruleId: String(ruleId), // force to string + severity: mapSeverity(vuln.severity), + type: "VULNERABILITY", + primaryLocation: { + message: `${vuln.name} ${vuln.range} is vulnerable (${vuln.via + .map((v) => (typeof v === "string" ? v : v.title || v.source || "")) + .join(", ")})`, + filePath: "package-lock.json", + textRange: { startLine: 1, endLine: 1 }, + }, + }); +} + +// Convert npm outdated packages +for (const [pkg, info] of Object.entries(outdated)) { + if (info.current !== info.latest) { + issues.push({ + engineId: "npm-outdated", + ruleId: "outdated-dependency", + severity: mapOutdatedSeverity(info.current, info.latest), + type: "CODE_SMELL", + primaryLocation: { + message: `Package ${pkg} is outdated (current ${info.current}, latest ${info.latest})`, + filePath: "package.json", + textRange: { startLine: 1, endLine: 1 }, + }, + }); + } +} + +// Severity mapping helpers +function mapSeverity(sev) { + switch (sev) { + case "low": + return "INFO"; + case "moderate": + return "MINOR"; + case "high": + return "MAJOR"; + case "critical": + return "BLOCKER"; + default: + return "MINOR"; + } +} + +function mapOutdatedSeverity(current, latest) { + // crude version check: major bump = MAJOR, minor/patch = MINOR + const [cMaj] = current.split("."); + const [lMaj] = latest.split("."); + return cMaj !== lMaj ? "MAJOR" : "MINOR"; +} + +// Write combined report +fs.writeFileSync("npm-sonar.json", JSON.stringify({ issues }, null, 2)); diff --git a/scripts/generateVersion.ps1 b/scripts/generateVersion.ps1 new file mode 100644 index 0000000..c2a96ae --- /dev/null +++ b/scripts/generateVersion.ps1 @@ -0,0 +1,57 @@ +# Ensure GitVersion is installed (you can install via Chocolatey or manually) +# choco install gitversion.portable -y + +# Navigate to your repository root +# Set-Location "C:\Path\To\Your\Repository" + +# Run GitVersion and output JSON +# $gitVersionOutput = gitversion /output json + +# Display the JSON output +# $gitVersionOutput | ConvertFrom-Json | Format-List + +# Fetch all tags to ensure GitVersion has the latest tag information +git fetch --tags +# Alternatively, using Docker to run GitVersion without installing it locally +# Run GitVersion via Docker and capture JSON output +$gitVersionJson = docker run --rm -v "${PWD}:/repo" gittools/gitversion:6.3.0 /repo /output json + +# Parse JSON +$versionData = $gitVersionJson | ConvertFrom-Json + +# Remove any existing version-*.txt files in the current directory +Get-ChildItem -Path . -Filter "version-*.txt" | Remove-Item -Force + +# Replace 'PullRequest' with 'Patch' in SemVer +$VERSION = $versionData.SemVer -replace 'PullRequest', 'Patch' +$FULL_SEMVER = $versionData.FullSemVer +$MAJOR_MINOR_PATCH = $versionData.MajorMinorPatch +$GIT_HASH = $versionData.Sha +$GIT_TAG = $versionData.PreReleaseTag +$GIT_BRANCH = $versionData.BranchName +$COMMIT_COUNT = $versionData.CommitsSinceVersionSource +$BUILD_DATE = (Get-Date).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ") + +# Write to version-$VERSION.txt +$versionFile = "version-$VERSION.txt" +@" +version=$VERSION +major_minor_patch=$MAJOR_MINOR_PATCH +full_semver=$FULL_SEMVER +git_hash=$GIT_HASH +git_tag=$GIT_TAG +git_branch=$GIT_BRANCH +commit_count=$COMMIT_COUNT +build_date=$BUILD_DATE +"@ | Set-Content $versionFile + +# Output to console +Write-Host "Generated version: $VERSION" +Write-Host "Major minor patch: $MAJOR_MINOR_PATCH" +Write-Host "Full semver: $FULL_SEMVER" +Write-Host "Git hash: $GIT_HASH" +Write-Host "Git branch: $GIT_BRANCH" +Write-Host "Commit count: $COMMIT_COUNT" +Write-Host "Build date: $BUILD_DATE" +Write-Host "version.txt content:" +Get-Content $versionFile diff --git a/scripts/generateVersion.sh b/scripts/generateVersion.sh new file mode 100644 index 0000000..777ec30 --- /dev/null +++ b/scripts/generateVersion.sh @@ -0,0 +1,84 @@ +#!/usr/bin/env bash +set -euo pipefail + +# generateVersion.sh - Generate version metadata using GitVersion (via Docker or local install) +# Usage: ./scripts/generateVersion.sh +# Requirements: docker OR gitversion, and jq + +# Optional: set GITVERSION_IMAGE to use a different GitVersion Docker image +GITVERSION_IMAGE="gittools/gitversion:6.3.0" + +clean_up() { + [[ -n "${TMP_FILE:-}" && -f "$TMP_FILE" ]] && rm -f "$TMP_FILE" +} +trap clean_up EXIT + +echo "Fetching tags..." +git fetch --tags + +# Prepare temp file for json output +TMP_FILE=$(mktemp) + +if command -v docker >/dev/null 2>&1; then + echo "Running GitVersion (Docker): $GITVERSION_IMAGE" + docker run --rm -v "$(pwd):/repo" "$GITVERSION_IMAGE" /repo /output json > "$TMP_FILE" +elif command -v gitversion >/dev/null 2>&1; then + echo "Running GitVersion (local)" + gitversion /output json > "$TMP_FILE" +else + echo "Error: Docker or gitversion binary is required to run GitVersion." >&2 + exit 1 +fi + +if ! command -v jq >/dev/null 2>&1; then + echo "Error: jq is required to parse GitVersion JSON output. Install it (e.g., 'brew install jq')." >&2 + exit 1 +fi + +# Parse values with jq +SEMVER=$(jq -r '.SemVer // empty' "$TMP_FILE") +FULL_SEMVER=$(jq -r '.FullSemVer // empty' "$TMP_FILE") +MAJOR_MINOR_PATCH=$(jq -r '.MajorMinorPatch // empty' "$TMP_FILE") +GIT_HASH=$(jq -r '.Sha // empty' "$TMP_FILE") +GIT_TAG=$(jq -r '.PreReleaseTag // empty' "$TMP_FILE") +GIT_BRANCH=$(jq -r '.BranchName // empty' "$TMP_FILE") +COMMIT_COUNT=$(jq -r '.CommitsSinceVersionSource // 0' "$TMP_FILE") + +# Fallbacks +SEMVER=${SEMVER:-"0.0.0"} +FULL_SEMVER=${FULL_SEMVER:-"0.0.0+0"} +MAJOR_MINOR_PATCH=${MAJOR_MINOR_PATCH:-"0.0.0"} + +# Replace 'PullRequest' with 'Patch' in SemVer (per original script behaviour) +VERSION=${SEMVER//PullRequest/Patch} + +BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") + +# Remove any existing version-*.txt files in current dir +rm -f version-*.txt || true + +VERSION_FILE="version-$VERSION.txt" +cat > "$VERSION_FILE" <> $env:GITHUB_OUTPUT +Write-Output "MAJOR_MINOR_PATCH=$MAJOR_MINOR_PATCH" >> $env:GITHUB_OUTPUT +Write-Output "FULL_SEMVER=$FULL_SEMVER" >> $env:GITHUB_OUTPUT +Write-Output "GIT_HASH=$GIT_HASH" >> $env:GITHUB_OUTPUT +Write-Output "GIT_TAG=$GIT_TAG" >> $env:GITHUB_OUTPUT +Write-Output "GIT_BRANCH=$GIT_BRANCH" >> $env:GITHUB_OUTPUT +Write-Output "COMMIT_COUNT=$COMMIT_COUNT" >> $env:GITHUB_OUTPUT +Write-Output "BUILD_DATE=$BUILD_DATE" >> $env:GITHUB_OUTPUT + +Write-Host "Using version: $VERSION" +Write-Host "Major minor patch: $MAJOR_MINOR_PATCH" +Write-Host "Full semver: $FULL_SEMVER" +Write-Host "Git hash: $GIT_HASH" +Write-Host "Git branch: $GIT_BRANCH" +Write-Host "Commit count: $COMMIT_COUNT" +Write-Host "Build date: $BUILD_DATE" + +# Parse MAJOR, MINOR, PATCH from MAJOR_MINOR_PATCH (format: "MAJOR.MINOR.PATCH") +$versionParts = $MAJOR_MINOR_PATCH -split '\.' +$MAJOR = if ($versionParts.Count -gt 0) { [int]$versionParts[0] } else { 0 } +$MINOR = if ($versionParts.Count -gt 1) { [int]$versionParts[1] } else { 0 } +$PATCH = if ($versionParts.Count -gt 2) { [int]$versionParts[2] } else { 0 } + +# Compute versionCode: MAJOR * 1000000 + MINOR * 10000 + PATCH * 100 + COMMIT_COUNT +$VERSION_CODE = $MAJOR * 1000000 + $MINOR * 10000 + $PATCH * 100 + [int]$COMMIT_COUNT +Write-Host "Android versionCode: $VERSION_CODE (MAJOR=$MAJOR MINOR=$MINOR PATCH=$PATCH COMMIT_COUNT=$COMMIT_COUNT)" + +# Update package.json only +$packageJson = "package.json" +if (Test-Path $packageJson) { + # Read file as raw text to perform a single replace operation + $content = Get-Content $packageJson -Raw + $replacement = '"version": "' + $VERSION + '"' + $new = $content -replace '"version"\s*:\s*"[^"]*"', $replacement + Set-Content -Path $packageJson -Value $new + Write-Host "Updated $packageJson to version $VERSION" +} else { + Write-Host "package.json not found: $packageJson" +} + +Write-Host "Version update complete." diff --git a/scripts/updateVersion.sh b/scripts/updateVersion.sh new file mode 100644 index 0000000..13fc71b --- /dev/null +++ b/scripts/updateVersion.sh @@ -0,0 +1,98 @@ +#!/usr/bin/env bash +set -euo pipefail + +# updateVersion.sh +# Reads version-*.txt (generated by generateVersion.sh) and updates project files: +# - index.html (${VERSION} placeholder) +# - src-tauri/tauri.conf.json (replace ${VERSION} and "version": "..." +# - android/app/build.gradle (versionName and versionCode) +# - ios/App/App/Info.plist (CFBundleShortVersionString and CFBundleVersion) +# Usage: ./scripts/updateVersion.sh + +# Find version file +VERSION_FILE=$(ls version-*.txt 2>/dev/null | head -n1 || true) +if [[ -z "$VERSION_FILE" ]]; then + echo "No version-*.txt found. Using fallback values." >&2 + VERSION="0.0.2-fallback" + MAJOR_MINOR_PATCH="0.0.2" + FULL_SEMVER="0.0.2-fallback" + GIT_HASH="unknown" + GIT_TAG="allback" + GIT_BRANCH="unknown" + COMMIT_COUNT=0 + BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") +else + echo "Reading version info from $VERSION_FILE" + # shellcheck disable=SC2002 + VERSION=$(grep '^version=' "$VERSION_FILE" | head -n1 | cut -d'=' -f2-) + MAJOR_MINOR_PATCH=$(grep '^major_minor_patch=' "$VERSION_FILE" | head -n1 | cut -d'=' -f2-) + FULL_SEMVER=$(grep '^full_semver=' "$VERSION_FILE" | head -n1 | cut -d'=' -f2-) + GIT_HASH=$(grep '^git_hash=' "$VERSION_FILE" | head -n1 | cut -d'=' -f2-) + GIT_TAG=$(grep '^git_tag=' "$VERSION_FILE" | head -n1 | cut -d'=' -f2-) + GIT_BRANCH=$(grep '^git_branch=' "$VERSION_FILE" | head -n1 | cut -d'=' -f2-) + COMMIT_COUNT=$(grep '^commit_count=' "$VERSION_FILE" | head -n1 | cut -d'=' -f2-) + BUILD_DATE=$(grep '^build_date=' "$VERSION_FILE" | head -n1 | cut -d'=' -f2-) +fi + +# Fallbacks +VERSION=${VERSION:-"0.0.2-fallback"} +MAJOR_MINOR_PATCH=${MAJOR_MINOR_PATCH:-"0.0.2"} +FULL_SEMVER=${FULL_SEMVER:-"0.0.2-fallback"} +COMMIT_COUNT=${COMMIT_COUNT:-0} + +# ensure COMMIT_COUNT is integer +if ! [[ "$COMMIT_COUNT" =~ ^[0-9]+$ ]]; then + COMMIT_COUNT=0 +fi + +# Parse MAJOR, MINOR, PATCH from MAJOR_MINOR_PATCH (format: "MAJOR.MINOR.PATCH") +IFS='.' read -r MAJOR MINOR PATCH <<< "$MAJOR_MINOR_PATCH" +MAJOR=${MAJOR:-0} +MINOR=${MINOR:-0} +PATCH=${PATCH:-0} + +# Ensure MAJOR, MINOR, PATCH are integers +MAJOR=$((MAJOR + 0)) +MINOR=$((MINOR + 0)) +PATCH=$((PATCH + 0)) + +# Compute versionCode: MAJOR * 1000000 + MINOR * 10000 + PATCH * 100 + COMMIT_COUNT +VERSION_CODE=$((MAJOR * 1000000 + MINOR * 10000 + PATCH * 100 + COMMIT_COUNT)) + +# Export outputs for GitHub Actions if $GITHUB_OUTPUT exists +if [[ -n "${GITHUB_OUTPUT:-}" ]]; then + { + echo "VERSION=$VERSION" + echo "MAJOR_MINOR_PATCH=$MAJOR_MINOR_PATCH" + echo "FULL_SEMVER=$FULL_SEMVER" + echo "GIT_HASH=$GIT_HASH" + echo "GIT_TAG=$GIT_TAG" + echo "GIT_BRANCH=$GIT_BRANCH" + echo "COMMIT_COUNT=$COMMIT_COUNT" + echo "BUILD_DATE=$BUILD_DATE" + } >> "$GITHUB_OUTPUT" +fi + +# Print summary +cat <&2 +fi + +echo "Version update complete." diff --git a/src/index.ts b/src/index.ts index b9875a6..dc5b5f6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -459,44 +459,26 @@ export class SqlSimpleParser { } if (this.foreignKeyList.length > 0) { this.foreignKeyList.forEach((fk) => { - // find table index - const pkTableIndex = this.tableList.findIndex( + const tableIndex = this.tableList.findIndex( (t) => - t.Name.toLocaleLowerCase() == + t.Name.toLocaleLowerCase() === fk.ReferencesTableName.toLocaleLowerCase() ); - // let fkTableIndex = this.tableList.findIndex( - // (t) => t.Name == fk.PrimaryKeyTableName - // ); - - // find property index - if (pkTableIndex > -1) { - const propertyIndex = this.tableList[pkTableIndex].Properties.findIndex( + if (tableIndex > -1) { + const propertyIndex = this.tableList[tableIndex].Properties.findIndex( (p) => - p.Name.toLocaleLowerCase() == - fk.PrimaryKeyName.toLocaleLowerCase() + p.Name.toLocaleLowerCase() === + fk.ReferencesPropertyName.toLocaleLowerCase() ); if (propertyIndex > -1) { - this.tableList[pkTableIndex].Properties[ - propertyIndex - ].ForeignKey.push(fk); + const property = this.tableList[tableIndex].Properties[propertyIndex]; + property.ForeignKey.push(fk); if (!fk.IsDestination) { - this.tableList[pkTableIndex].Properties[ - propertyIndex - ].IsForeignKey = true; + property.IsForeignKey = true; } } } - - // if (fkTableIndex > -1) { - // let propertyIndex = this.tableList[fkTableIndex].Properties.findIndex( - // (p) => p.Name == fk.PrimaryKeyName - // ); - // if (propertyIndex > -1) { - // this.tableList[fkTableIndex].Properties[propertyIndex].ForeignKey.push(fk) - // } - // } }); } diff --git a/tests/data/results/ToModel.json b/tests/data/results/ToModel.json index 9bfad8f..9e66abe 100644 --- a/tests/data/results/ToModel.json +++ b/tests/data/results/ToModel.json @@ -44,7 +44,15 @@ "Name": "EmployeeId", "ColumnProperties": "INTEGER NOT NULL", "TableName": "Employee", - "ForeignKey": [], + "ForeignKey": [ + { + "PrimaryKeyTableName": "Customer", + "PrimaryKeyName": "SupportRepId", + "ReferencesPropertyName": "EmployeeId", + "ReferencesTableName": "Employee", + "IsDestination": true + } + ], "IsForeignKey": false, "IsPrimaryKey": true }, @@ -405,8 +413,16 @@ "Name": "SupportRepId", "ColumnProperties": "INTEGER", "TableName": "Customer", - "ForeignKey": [], - "IsForeignKey": false, + "ForeignKey": [ + { + "PrimaryKeyTableName": "Employee", + "PrimaryKeyName": "EmployeeId", + "ReferencesPropertyName": "SupportRepId", + "ReferencesTableName": "Customer", + "IsDestination": false + } + ], + "IsForeignKey": true, "IsPrimaryKey": false } ] @@ -6234,6 +6250,13 @@ "ColumnProperties": "serial NOT NULL", "TableName": "person_businessentity", "ForeignKey": [ + { + "PrimaryKeyTableName": "person_person", + "PrimaryKeyName": "person_person_businessentityid", + "ReferencesPropertyName": "businessentityid", + "ReferencesTableName": "person_businessentity", + "IsDestination": true + }, { "PrimaryKeyTableName": "purchasing_vendor", "PrimaryKeyName": "businessentityid", @@ -6960,6 +6983,20 @@ "ColumnProperties": "bpchar NOT NULL", "TableName": "production_unitmeasure", "ForeignKey": [ + { + "PrimaryKeyTableName": "production_product", + "PrimaryKeyName": "sizeunitmeasurecode", + "ReferencesPropertyName": "unitmeasurecode", + "ReferencesTableName": "production_unitmeasure", + "IsDestination": true + }, + { + "PrimaryKeyTableName": "production_product", + "PrimaryKeyName": "weightunitmeasurecode", + "ReferencesPropertyName": "unitmeasurecode", + "ReferencesTableName": "production_unitmeasure", + "IsDestination": true + }, { "PrimaryKeyTableName": "production_billofmaterials", "PrimaryKeyName": "unitmeasurecode", @@ -7146,6 +7183,20 @@ "ReferencesPropertyName": "currencycode", "ReferencesTableName": "sales_currency", "IsDestination": true + }, + { + "PrimaryKeyTableName": "sales_currencyrate", + "PrimaryKeyName": "fromcurrencycode", + "ReferencesPropertyName": "currencycode", + "ReferencesTableName": "sales_currency", + "IsDestination": true + }, + { + "PrimaryKeyTableName": "sales_currencyrate", + "PrimaryKeyName": "tocurrencycode", + "ReferencesPropertyName": "currencycode", + "ReferencesTableName": "sales_currency", + "IsDestination": true } ], "IsForeignKey": false, @@ -7324,15 +7375,15 @@ "TableName": "person_person", "ForeignKey": [ { - "PrimaryKeyTableName": "person_businessentity", + "PrimaryKeyTableName": "humanresources_employee", "PrimaryKeyName": "businessentityid", - "ReferencesPropertyName": "person_person_businessentityid", + "ReferencesPropertyName": "businessentityid", "ReferencesTableName": "person_person", - "IsDestination": false + "IsDestination": true }, { - "PrimaryKeyTableName": "humanresources_employee", - "PrimaryKeyName": "businessentityid", + "PrimaryKeyTableName": "person_businessentitycontact", + "PrimaryKeyName": "personid", "ReferencesPropertyName": "businessentityid", "ReferencesTableName": "person_person", "IsDestination": true @@ -7364,9 +7415,16 @@ "ReferencesPropertyName": "businessentityid", "ReferencesTableName": "person_person", "IsDestination": true + }, + { + "PrimaryKeyTableName": "sales_customer", + "PrimaryKeyName": "personid", + "ReferencesPropertyName": "businessentityid", + "ReferencesTableName": "person_person", + "IsDestination": true } ], - "IsForeignKey": true, + "IsForeignKey": false, "IsPrimaryKey": true }, { @@ -7655,6 +7713,13 @@ "ReferencesPropertyName": "businessentityid", "ReferencesTableName": "purchasing_vendor", "IsDestination": true + }, + { + "PrimaryKeyTableName": "purchasing_purchaseorderheader", + "PrimaryKeyName": "vendorid", + "ReferencesPropertyName": "businessentityid", + "ReferencesTableName": "purchasing_vendor", + "IsDestination": true } ], "IsForeignKey": true, @@ -7794,16 +7859,32 @@ "Name": "fromcurrencycode", "ColumnProperties": "bpchar NOT NULL", "TableName": "sales_currencyrate", - "ForeignKey": [], - "IsForeignKey": false, + "ForeignKey": [ + { + "PrimaryKeyTableName": "sales_currency", + "PrimaryKeyName": "currencycode", + "ReferencesPropertyName": "fromcurrencycode", + "ReferencesTableName": "sales_currencyrate", + "IsDestination": false + } + ], + "IsForeignKey": true, "IsPrimaryKey": false }, { "Name": "tocurrencycode", "ColumnProperties": "bpchar NOT NULL", "TableName": "sales_currencyrate", - "ForeignKey": [], - "IsForeignKey": false, + "ForeignKey": [ + { + "PrimaryKeyTableName": "sales_currency", + "PrimaryKeyName": "currencycode", + "ReferencesPropertyName": "tocurrencycode", + "ReferencesTableName": "sales_currencyrate", + "IsDestination": false + } + ], + "IsForeignKey": true, "IsPrimaryKey": false }, { @@ -7997,6 +8078,20 @@ "ReferencesTableName": "humanresources_employee", "IsDestination": true }, + { + "PrimaryKeyTableName": "production_document", + "PrimaryKeyName": "owner", + "ReferencesPropertyName": "businessentityid", + "ReferencesTableName": "humanresources_employee", + "IsDestination": true + }, + { + "PrimaryKeyTableName": "purchasing_purchaseorderheader", + "PrimaryKeyName": "employeeid", + "ReferencesPropertyName": "businessentityid", + "ReferencesTableName": "humanresources_employee", + "IsDestination": true + }, { "PrimaryKeyTableName": "sales_salesperson", "PrimaryKeyName": "businessentityid", @@ -8136,13 +8231,6 @@ "ReferencesPropertyName": "businessentityid", "ReferencesTableName": "person_businessentitycontact", "IsDestination": false - }, - { - "PrimaryKeyTableName": "person_person", - "PrimaryKeyName": "businessentityid", - "ReferencesPropertyName": "personid", - "ReferencesTableName": "person_businessentitycontact", - "IsDestination": false } ], "IsForeignKey": true, @@ -8152,8 +8240,16 @@ "Name": "personid", "ColumnProperties": "int(4) NOT NULL", "TableName": "person_businessentitycontact", - "ForeignKey": [], - "IsForeignKey": false, + "ForeignKey": [ + { + "PrimaryKeyTableName": "person_person", + "PrimaryKeyName": "businessentityid", + "ReferencesPropertyName": "personid", + "ReferencesTableName": "person_businessentitycontact", + "IsDestination": false + } + ], + "IsForeignKey": true, "IsPrimaryKey": true }, { @@ -8457,6 +8553,20 @@ "ColumnProperties": "serial NOT NULL", "TableName": "production_product", "ForeignKey": [ + { + "PrimaryKeyTableName": "production_billofmaterials", + "PrimaryKeyName": "componentid", + "ReferencesPropertyName": "productid", + "ReferencesTableName": "production_product", + "IsDestination": true + }, + { + "PrimaryKeyTableName": "production_billofmaterials", + "PrimaryKeyName": "productassemblyid", + "ReferencesPropertyName": "productid", + "ReferencesTableName": "production_product", + "IsDestination": true + }, { "PrimaryKeyTableName": "production_productcosthistory", "PrimaryKeyName": "productid", @@ -8622,16 +8732,32 @@ "Name": "sizeunitmeasurecode", "ColumnProperties": "bpchar", "TableName": "production_product", - "ForeignKey": [], - "IsForeignKey": false, + "ForeignKey": [ + { + "PrimaryKeyTableName": "production_unitmeasure", + "PrimaryKeyName": "unitmeasurecode", + "ReferencesPropertyName": "sizeunitmeasurecode", + "ReferencesTableName": "production_product", + "IsDestination": false + } + ], + "IsForeignKey": true, "IsPrimaryKey": false }, { "Name": "weightunitmeasurecode", "ColumnProperties": "bpchar", "TableName": "production_product", - "ForeignKey": [], - "IsForeignKey": false, + "ForeignKey": [ + { + "PrimaryKeyTableName": "production_unitmeasure", + "PrimaryKeyName": "unitmeasurecode", + "ReferencesPropertyName": "weightunitmeasurecode", + "ReferencesTableName": "production_product", + "IsDestination": false + } + ], + "IsForeignKey": true, "IsPrimaryKey": false }, { @@ -8982,6 +9108,20 @@ "ReferencesPropertyName": "addressid", "ReferencesTableName": "person_address", "IsDestination": true + }, + { + "PrimaryKeyTableName": "sales_salesorderheader", + "PrimaryKeyName": "billtoaddressid", + "ReferencesPropertyName": "addressid", + "ReferencesTableName": "person_address", + "IsDestination": true + }, + { + "PrimaryKeyTableName": "sales_salesorderheader", + "PrimaryKeyName": "shiptoaddressid", + "ReferencesPropertyName": "addressid", + "ReferencesTableName": "person_address", + "IsDestination": true } ], "IsForeignKey": false, @@ -9076,16 +9216,32 @@ "Name": "productassemblyid", "ColumnProperties": "int(4)", "TableName": "production_billofmaterials", - "ForeignKey": [], - "IsForeignKey": false, + "ForeignKey": [ + { + "PrimaryKeyTableName": "production_product", + "PrimaryKeyName": "productid", + "ReferencesPropertyName": "productassemblyid", + "ReferencesTableName": "production_billofmaterials", + "IsDestination": false + } + ], + "IsForeignKey": true, "IsPrimaryKey": false }, { "Name": "componentid", "ColumnProperties": "int(4) NOT NULL", "TableName": "production_billofmaterials", - "ForeignKey": [], - "IsForeignKey": false, + "ForeignKey": [ + { + "PrimaryKeyTableName": "production_product", + "PrimaryKeyName": "productid", + "ReferencesPropertyName": "componentid", + "ReferencesTableName": "production_billofmaterials", + "IsDestination": false + } + ], + "IsForeignKey": true, "IsPrimaryKey": false }, { @@ -9161,8 +9317,16 @@ "Name": "owner", "ColumnProperties": "int(4) NOT NULL", "TableName": "production_document", - "ForeignKey": [], - "IsForeignKey": false, + "ForeignKey": [ + { + "PrimaryKeyTableName": "humanresources_employee", + "PrimaryKeyName": "businessentityid", + "ReferencesPropertyName": "owner", + "ReferencesTableName": "production_document", + "IsDestination": false + } + ], + "IsForeignKey": true, "IsPrimaryKey": false }, { @@ -9841,16 +10005,32 @@ "Name": "employeeid", "ColumnProperties": "int(4) NOT NULL", "TableName": "purchasing_purchaseorderheader", - "ForeignKey": [], - "IsForeignKey": false, + "ForeignKey": [ + { + "PrimaryKeyTableName": "humanresources_employee", + "PrimaryKeyName": "businessentityid", + "ReferencesPropertyName": "employeeid", + "ReferencesTableName": "purchasing_purchaseorderheader", + "IsDestination": false + } + ], + "IsForeignKey": true, "IsPrimaryKey": false }, { "Name": "vendorid", "ColumnProperties": "int(4) NOT NULL", "TableName": "purchasing_purchaseorderheader", - "ForeignKey": [], - "IsForeignKey": false, + "ForeignKey": [ + { + "PrimaryKeyTableName": "purchasing_vendor", + "PrimaryKeyName": "businessentityid", + "ReferencesPropertyName": "vendorid", + "ReferencesTableName": "purchasing_purchaseorderheader", + "IsDestination": false + } + ], + "IsForeignKey": true, "IsPrimaryKey": false }, { @@ -9947,6 +10127,20 @@ "ReferencesPropertyName": "businessentityid", "ReferencesTableName": "sales_salesperson", "IsDestination": true + }, + { + "PrimaryKeyTableName": "sales_store", + "PrimaryKeyName": "salespersonid", + "ReferencesPropertyName": "businessentityid", + "ReferencesTableName": "sales_salesperson", + "IsDestination": true + }, + { + "PrimaryKeyTableName": "sales_salesorderheader", + "PrimaryKeyName": "salespersonid", + "ReferencesPropertyName": "businessentityid", + "ReferencesTableName": "sales_salesperson", + "IsDestination": true } ], "IsForeignKey": true, @@ -10671,11 +10865,11 @@ "IsDestination": false }, { - "PrimaryKeyTableName": "sales_salesperson", - "PrimaryKeyName": "businessentityid", - "ReferencesPropertyName": "salespersonid", + "PrimaryKeyTableName": "sales_customer", + "PrimaryKeyName": "storeid", + "ReferencesPropertyName": "businessentityid", "ReferencesTableName": "sales_store", - "IsDestination": false + "IsDestination": true } ], "IsForeignKey": true, @@ -10693,8 +10887,16 @@ "Name": "salespersonid", "ColumnProperties": "int(4)", "TableName": "sales_store", - "ForeignKey": [], - "IsForeignKey": false, + "ForeignKey": [ + { + "PrimaryKeyTableName": "sales_salesperson", + "PrimaryKeyName": "businessentityid", + "ReferencesPropertyName": "salespersonid", + "ReferencesTableName": "sales_store", + "IsDestination": false + } + ], + "IsForeignKey": true, "IsPrimaryKey": false }, { @@ -10746,16 +10948,32 @@ "Name": "personid", "ColumnProperties": "int(4)", "TableName": "sales_customer", - "ForeignKey": [], - "IsForeignKey": false, + "ForeignKey": [ + { + "PrimaryKeyTableName": "person_person", + "PrimaryKeyName": "businessentityid", + "ReferencesPropertyName": "personid", + "ReferencesTableName": "sales_customer", + "IsDestination": false + } + ], + "IsForeignKey": true, "IsPrimaryKey": false }, { "Name": "storeid", "ColumnProperties": "int(4)", "TableName": "sales_customer", - "ForeignKey": [], - "IsForeignKey": false, + "ForeignKey": [ + { + "PrimaryKeyTableName": "sales_store", + "PrimaryKeyName": "businessentityid", + "ReferencesPropertyName": "storeid", + "ReferencesTableName": "sales_customer", + "IsDestination": false + } + ], + "IsForeignKey": true, "IsPrimaryKey": false }, { @@ -10902,8 +11120,16 @@ "Name": "salespersonid", "ColumnProperties": "int(4)", "TableName": "sales_salesorderheader", - "ForeignKey": [], - "IsForeignKey": false, + "ForeignKey": [ + { + "PrimaryKeyTableName": "sales_salesperson", + "PrimaryKeyName": "businessentityid", + "ReferencesPropertyName": "salespersonid", + "ReferencesTableName": "sales_salesorderheader", + "IsDestination": false + } + ], + "IsForeignKey": true, "IsPrimaryKey": false }, { @@ -10926,16 +11152,32 @@ "Name": "billtoaddressid", "ColumnProperties": "int(4) NOT NULL", "TableName": "sales_salesorderheader", - "ForeignKey": [], - "IsForeignKey": false, + "ForeignKey": [ + { + "PrimaryKeyTableName": "person_address", + "PrimaryKeyName": "addressid", + "ReferencesPropertyName": "billtoaddressid", + "ReferencesTableName": "sales_salesorderheader", + "IsDestination": false + } + ], + "IsForeignKey": true, "IsPrimaryKey": false }, { "Name": "shiptoaddressid", "ColumnProperties": "int(4) NOT NULL", "TableName": "sales_salesorderheader", - "ForeignKey": [], - "IsForeignKey": false, + "ForeignKey": [ + { + "PrimaryKeyTableName": "person_address", + "PrimaryKeyName": "addressid", + "ReferencesPropertyName": "shiptoaddressid", + "ReferencesTableName": "sales_salesorderheader", + "IsDestination": false + } + ], + "IsForeignKey": true, "IsPrimaryKey": false }, { @@ -19585,6 +19827,20 @@ "ReferencesPropertyName": "AddressID", "ReferencesTableName": "SalesLT.Address", "IsDestination": true + }, + { + "PrimaryKeyTableName": "SalesLT.SalesOrderHeader", + "PrimaryKeyName": "BillToAddressID", + "ReferencesPropertyName": "AddressID", + "ReferencesTableName": "SalesLT.Address", + "IsDestination": true + }, + { + "PrimaryKeyTableName": "SalesLT.SalesOrderHeader", + "PrimaryKeyName": "ShipToAddressID", + "ReferencesPropertyName": "AddressID", + "ReferencesTableName": "SalesLT.Address", + "IsDestination": true } ], "IsForeignKey": false, @@ -20405,16 +20661,32 @@ "Name": "ShipToAddressID", "ColumnProperties": "[int] NULL", "TableName": "SalesLT.SalesOrderHeader", - "ForeignKey": [], - "IsForeignKey": false, + "ForeignKey": [ + { + "PrimaryKeyTableName": "SalesLT.Address", + "PrimaryKeyName": "AddressID", + "ReferencesPropertyName": "ShipToAddressID", + "ReferencesTableName": "SalesLT.SalesOrderHeader", + "IsDestination": false + } + ], + "IsForeignKey": true, "IsPrimaryKey": false }, { "Name": "BillToAddressID", "ColumnProperties": "[int] NULL", "TableName": "SalesLT.SalesOrderHeader", - "ForeignKey": [], - "IsForeignKey": false, + "ForeignKey": [ + { + "PrimaryKeyTableName": "SalesLT.Address", + "PrimaryKeyName": "AddressID", + "ReferencesPropertyName": "BillToAddressID", + "ReferencesTableName": "SalesLT.SalesOrderHeader", + "IsDestination": false + } + ], + "IsForeignKey": true, "IsPrimaryKey": false }, { From d22ef3880f70982d0770b9c05ca4de51236d8ed3 Mon Sep 17 00:00:00 2001 From: lastlink Date: Mon, 9 Feb 2026 16:45:20 -0500 Subject: [PATCH 2/2] update action --- .github/dependabot.yml | 11 ++++++++++- .github/workflows/tests.yaml | 6 ++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 82f820e..5d35488 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -14,4 +14,13 @@ updates: - "dependencies" - "npm" rebase-strategy: "auto" - + + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + open-pull-requests-limit: 5 + labels: + - "dependencies" + - "github-actions" + rebase-strategy: "auto" diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 10367fe..aa7fea8 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -96,10 +96,11 @@ jobs: - run: npm ci - run: npm test - name: upload junit - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v4 with: name: junit path: junit.xml + retention-days: ${{ env.retention_days }} # displays in summary page - name: Publish Test Report uses: mikepenz/action-junit-report@v3 @@ -114,10 +115,11 @@ jobs: path: junit.xml - run: npm run test:coverage - name: upload code coverage - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v4 with: name: Report-CodeCoverage path: coverage + retention-days: ${{ env.retention_days }} # adds coverage comment to pr - name: parse coverage uses: danhunsaker/clover-reporter-action@v0.2.17-clover