From ab12ccda5eebd2d616aefe9b9865edd822022605 Mon Sep 17 00:00:00 2001 From: Steffen Zellmer <151627820+Steffen025@users.noreply.github.com> Date: Sun, 12 Apr 2026 02:01:40 +0200 Subject: [PATCH 1/2] fix(ci): apply StepSecurity hardening (PR #106) + coderabbit corrections MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Applies the StepSecurity security improvements from PR #106 and fixes all 6 CodeRabbit findings on top. StepSecurity changes (from PR #106 by StepSecurity Bot): - dependabot.yml: daily automated dependency updates for GitHub Actions and all npm workspaces in the repo - ci.yml / code-quality.yml: pinned actions to SHA, added harden-runner - codeql.yml: new CodeQL SAST workflow (JavaScript/TypeScript + Python) - dependency-review.yml: new dependency vulnerability scan on every PR - opencode.yml: pinned anomalyco/opencode/github to SHA, harden-runner - scorecards.yml: new OpenSSF Scorecard workflow for supply-chain scoring - upstream-sync-*.yml: pinned github-script to SHA, harden-runner - upstream-sync-pai.yml: added top-level permissions: contents: read - .pre-commit-config.yaml: pre-commit hooks for detect-secrets, end-of-file-fixer, trailing-whitespace, check-yaml, check-json, check-merge-conflict CodeRabbit corrections (6 findings, all valid): 1. codeql.yml line 38: replaced ['javascript', 'python', 'typescript'] with ['javascript-typescript', 'python'] — CodeQL requires the combined identifier 'javascript-typescript' for JS/TS; separate entries are invalid and would cause the analyze step to error. 2. opencode.yml line 40: updated comment from '# latest' to '# pinned to 77fc88c8' to accurately describe that the action is pinned to a specific commit SHA, not a mutable 'latest' tag. 3. upstream-sync-opencode.yml: added workflow-level permissions block (contents: read, issues: write) before the jobs section. The workflow calls actions/github-script to read releases and create issues but had no top-level permissions block, risking default overly-broad GITHUB_TOKEN scopes. 4. upstream-sync-pai.yml job permissions: the job-level block only had issues: write, causing actions/checkout to lack repository read access. Added contents: read alongside issues: write. 5. ci.yml: added top-level permissions: contents: read before jobs to prevent the CI job from inheriting the default write-all token scope. 6. code-quality.yml: added top-level permissions: contents: read before jobs for the same reason as ci.yml (Biome check doesn't need write access). Credit: StepSecurity Bot opened PR #106 (app.stepsecurity.io) at the request of @Steffen025. Coderabbit findings applied on top. --- .github/dependabot.yml | 76 ++++++++++++++++++ .github/workflows/ci.yml | 12 ++- .github/workflows/code-quality.yml | 12 ++- .github/workflows/codeql.yml | 79 +++++++++++++++++++ .github/workflows/dependency-review.yml | 27 +++++++ .github/workflows/opencode.yml | 12 ++- .github/workflows/scorecards.yml | 81 ++++++++++++++++++++ .github/workflows/upstream-sync-opencode.yml | 17 +++- .github/workflows/upstream-sync-pai.yml | 21 +++-- .pre-commit-config.yaml | 22 ++++++ 10 files changed, 343 insertions(+), 16 deletions(-) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/codeql.yml create mode 100644 .github/workflows/dependency-review.yml create mode 100644 .github/workflows/scorecards.yml create mode 100644 .pre-commit-config.yaml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..2a01390f --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,76 @@ +version: 2 +updates: + - package-ecosystem: github-actions + directory: / + schedule: + interval: daily + + - package-ecosystem: npm + directory: /.opencode/PAI/Tools/pipeline-monitor-ui + schedule: + interval: daily + + - package-ecosystem: npm + directory: /.opencode/observability-server/dashboard + schedule: + interval: daily + + - package-ecosystem: npm + directory: /.opencode/observability-server + schedule: + interval: daily + + - package-ecosystem: npm + directory: /.opencode + schedule: + interval: daily + + - package-ecosystem: npm + directory: /.opencode/skills/Agents/Tools + schedule: + interval: daily + + - package-ecosystem: npm + directory: /.opencode/skills/Media/Remotion/Tools + schedule: + interval: daily + + - package-ecosystem: npm + directory: /.opencode/skills/Scraping/Apify + schedule: + interval: daily + + - package-ecosystem: npm + directory: /.opencode/skills/Security/WebAssessment/BugBountyTool + schedule: + interval: daily + + - package-ecosystem: npm + directory: /.opencode/skills/Telos/DashboardTemplate + schedule: + interval: daily + + - package-ecosystem: npm + directory: /.opencode/skills/Telos/ReportTemplate + schedule: + interval: daily + + - package-ecosystem: npm + directory: /.opencode/skills/Utilities/Browser + schedule: + interval: daily + + - package-ecosystem: npm + directory: /.opencode/skills/Utilities/Pptx/Scripts + schedule: + interval: daily + + - package-ecosystem: npm + directory: /.opencode/skills/Utilities/Prompting/Templates/Tools + schedule: + interval: daily + + - package-ecosystem: npm + directory: / + schedule: + interval: daily diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1b26e22c..25123f0f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,6 +10,9 @@ on: - dev - main +permissions: + contents: read + jobs: ci: name: Lint + Typecheck + Secrets @@ -17,12 +20,17 @@ jobs: timeout-minutes: 10 steps: + - name: Harden the runner (Audit all outbound calls) + uses: step-security/harden-runner@f808768d1510423e83855289c910610ca9b43176 # v2.17.0 + with: + egress-policy: audit + - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 # ⚠️ CRITICAL: Bun only — NEVER use npm/pnpm (per TECHSTACKPREFERENCES.md) - name: Setup Bun - uses: oven-sh/setup-bun@v2 + uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 with: bun-version: latest diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml index 87dde52d..302a9950 100644 --- a/.github/workflows/code-quality.yml +++ b/.github/workflows/code-quality.yml @@ -6,17 +6,25 @@ on: pull_request: branches: [dev, main] +permissions: + contents: read + jobs: biome: name: Biome Check runs-on: ubuntu-latest steps: + - name: Harden the runner (Audit all outbound calls) + uses: step-security/harden-runner@f808768d1510423e83855289c910610ca9b43176 # v2.17.0 + with: + egress-policy: audit + - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - name: Setup Bun - uses: oven-sh/setup-bun@v2 + uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 with: bun-version: latest diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 00000000..bc9b2fe1 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,79 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL" + +on: + push: + branches: ["main"] + pull_request: + # The branches below must be a subset of the branches above + branches: ["main"] + schedule: + - cron: "0 0 * * 1" + +permissions: + contents: read + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: ["javascript-typescript", "python"] + # CodeQL supports a combined "javascript-typescript" analyzer for JS/TS. + # Using separate "javascript" and "typescript" entries is invalid. + # Learn more: https://aka.ms/codeql-docs/language-support + + steps: + - name: Harden the runner (Audit all outbound calls) + uses: step-security/harden-runner@f808768d1510423e83855289c910610ca9b43176 # v2.17.0 + with: + egress-policy: audit + + - name: Checkout repository + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@5c8a8a642e79153f5d047b10ec1cba1d1cc65699 # v3.35.1 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@5c8a8a642e79153f5d047b10ec1cba1d1cc65699 # v3.35.1 + + # ℹ️ Command-line programs to run using the OS shell. + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun + + # If the Autobuild fails above, remove it and uncomment the following three lines. + # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. + + # - run: | + # echo "Run, Build Application using script" + # ./location_of_script_within_repo/buildscript.sh + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@5c8a8a642e79153f5d047b10ec1cba1d1cc65699 # v3.35.1 + with: + category: "/language:${{matrix.language}}" diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml new file mode 100644 index 00000000..9c125043 --- /dev/null +++ b/.github/workflows/dependency-review.yml @@ -0,0 +1,27 @@ +# Dependency Review Action +# +# This Action will scan dependency manifest files that change as part of a Pull Request, +# surfacing known-vulnerable versions of the packages declared or updated in the PR. +# Once installed, if the workflow run is marked as required, +# PRs introducing known-vulnerable packages will be blocked from merging. +# +# Source repository: https://github.com/actions/dependency-review-action +name: 'Dependency Review' +on: [pull_request] + +permissions: + contents: read + +jobs: + dependency-review: + runs-on: ubuntu-latest + steps: + - name: Harden the runner (Audit all outbound calls) + uses: step-security/harden-runner@f808768d1510423e83855289c910610ca9b43176 # v2.17.0 + with: + egress-policy: audit + + - name: 'Checkout Repository' + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + - name: 'Dependency Review' + uses: actions/dependency-review-action@2031cfc080254a8a887f58cffee85186f0e49e48 # v4.9.0 diff --git a/.github/workflows/opencode.yml b/.github/workflows/opencode.yml index 59163af9..074e5e5b 100644 --- a/.github/workflows/opencode.yml +++ b/.github/workflows/opencode.yml @@ -6,6 +6,9 @@ on: pull_request_review_comment: types: [created] +permissions: + contents: read + jobs: opencode: # Only trigger on /opencode or /oc commands @@ -22,14 +25,19 @@ jobs: issues: write steps: + - name: Harden the runner (Audit all outbound calls) + uses: step-security/harden-runner@f808768d1510423e83855289c910610ca9b43176 # v2.17.0 + with: + egress-policy: audit + - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 with: fetch-depth: 1 persist-credentials: false - name: Run OpenCode - uses: anomalyco/opencode/github@latest + uses: anomalyco/opencode/github@77fc88c8ade8e5a620ebbe1197f3a572d29ae91a # pinned to 77fc88c8 env: # Optional: Falls du einen API Key hast, als Secret konfigurieren # ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} diff --git a/.github/workflows/scorecards.yml b/.github/workflows/scorecards.yml new file mode 100644 index 00000000..6803b807 --- /dev/null +++ b/.github/workflows/scorecards.yml @@ -0,0 +1,81 @@ +# This workflow uses actions that are not certified by GitHub. They are provided +# by a third-party and are governed by separate terms of service, privacy +# policy, and support documentation. + +name: Scorecard supply-chain security +on: + # For Branch-Protection check. Only the default branch is supported. See + # https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection + branch_protection_rule: + # To guarantee Maintained check is occasionally updated. See + # https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained + schedule: + - cron: '20 7 * * 2' + push: + branches: ["main"] + +# Declare default permissions as read only. +permissions: read-all + +jobs: + analysis: + name: Scorecard analysis + runs-on: ubuntu-latest + permissions: + # Needed to upload the results to code-scanning dashboard. + security-events: write + # Needed to publish results and get a badge (see publish_results below). + id-token: write + contents: read + actions: read + # To allow GraphQL ListCommits to work + issues: read + pull-requests: read + # To detect SAST tools + checks: read + + steps: + - name: Harden the runner (Audit all outbound calls) + uses: step-security/harden-runner@f808768d1510423e83855289c910610ca9b43176 # v2.17.0 + with: + egress-policy: audit + + - name: "Checkout code" + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + with: + persist-credentials: false + + - name: "Run analysis" + uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0 + with: + results_file: results.sarif + results_format: sarif + # (Optional) "write" PAT token. Uncomment the `repo_token` line below if: + # - you want to enable the Branch-Protection check on a *public* repository, or + # - you are installing Scorecards on a *private* repository + # To create the PAT, follow the steps in https://github.com/ossf/scorecard-action#authentication-with-pat. + # repo_token: ${{ secrets.SCORECARD_TOKEN }} + + # Public repositories: + # - Publish results to OpenSSF REST API for easy access by consumers + # - Allows the repository to include the Scorecard badge. + # - See https://github.com/ossf/scorecard-action#publishing-results. + # For private repositories: + # - `publish_results` will always be set to `false`, regardless + # of the value entered here. + publish_results: true + + # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF + # format to the repository Actions tab. + - name: "Upload artifact" + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + with: + name: SARIF file + path: results.sarif + retention-days: 5 + + # Upload the results to GitHub's code scanning dashboard. + - name: "Upload to code-scanning" + uses: github/codeql-action/upload-sarif@5c8a8a642e79153f5d047b10ec1cba1d1cc65699 # v3.35.1 + with: + sarif_file: results.sarif diff --git a/.github/workflows/upstream-sync-opencode.yml b/.github/workflows/upstream-sync-opencode.yml index 50b3728d..83b2ecf4 100644 --- a/.github/workflows/upstream-sync-opencode.yml +++ b/.github/workflows/upstream-sync-opencode.yml @@ -16,6 +16,10 @@ on: type: boolean default: false +permissions: + contents: read + issues: write + env: UPSTREAM_OWNER: anomalyco UPSTREAM_REPO: opencode @@ -27,8 +31,13 @@ jobs: runs-on: ubuntu-latest steps: + - name: Harden the runner (Audit all outbound calls) + uses: step-security/harden-runner@f808768d1510423e83855289c910610ca9b43176 # v2.17.0 + with: + egress-policy: audit + - name: Checkout fork - uses: actions/checkout@v4 + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 with: repository: ${{ env.FORK_REPO }} token: ${{ secrets.UPSTREAM_SYNC_TOKEN }} @@ -58,7 +67,7 @@ jobs: - name: Check for new releases id: check_releases - uses: actions/github-script@v7 + uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0 with: script: | const upstreamOwner = process.env.UPSTREAM_OWNER; @@ -96,7 +105,7 @@ jobs: - name: Create sync issue (commits) if: steps.check_commits.outputs.commits_behind != '0' - uses: actions/github-script@v7 + uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0 with: script: | const commitCount = '${{ steps.check_commits.outputs.commits_behind }}'; @@ -140,7 +149,7 @@ jobs: - name: Create sync issue (release) if: steps.check_releases.outputs.new_release == 'true' - uses: actions/github-script@v7 + uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0 with: script: | const releaseTag = '${{ steps.check_releases.outputs.release_tag }}'; diff --git a/.github/workflows/upstream-sync-pai.yml b/.github/workflows/upstream-sync-pai.yml index 83a7bd2f..0c491743 100644 --- a/.github/workflows/upstream-sync-pai.yml +++ b/.github/workflows/upstream-sync-pai.yml @@ -29,22 +29,31 @@ env: # WICHTIG: Das ist dein FORK auf GitHub (nicht der lokale Pfad!) FORK_REPO: Steffen025/Personal_AI_Infrastructure +permissions: + contents: read + jobs: check-upstream: name: Check PAI Upstream & Create Info Issue runs-on: ubuntu-latest permissions: issues: write - + contents: read + steps: + - name: Harden the runner (Audit all outbound calls) + uses: step-security/harden-runner@f808768d1510423e83855289c910610ca9b43176 # v2.17.0 + with: + egress-policy: audit + - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 with: fetch-depth: 1 - name: Fetch upstream commit history id: upstream_check - uses: actions/github-script@v7 + uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0 with: script: | const upstreamOwner = process.env.UPSTREAM_OWNER; @@ -126,7 +135,7 @@ jobs: - name: Check for new releases id: release_check - uses: actions/github-script@v7 + uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0 with: script: | const upstreamOwner = process.env.UPSTREAM_OWNER; @@ -170,7 +179,7 @@ jobs: - name: Create info issue (commits) if: steps.upstream_check.outputs.has_updates == 'true' - uses: actions/github-script@v7 + uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0 with: script: | const commitCount = '${{ steps.upstream_check.outputs.commit_count }}'; @@ -310,7 +319,7 @@ jobs: - name: Create release issue if: steps.release_check.outputs.new_release == 'true' - uses: actions/github-script@v7 + uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0 with: script: | const releaseTag = '${{ steps.release_check.outputs.release_tag }}'; diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..66d4c9be --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,22 @@ +repos: +- repo: https://github.com/gitleaks/gitleaks + rev: v8.16.3 + hooks: + - id: gitleaks +- repo: https://github.com/jumanjihouse/pre-commit-hooks + rev: 3.0.0 + hooks: + - id: shellcheck +- repo: https://github.com/pre-commit/mirrors-eslint + rev: v8.38.0 + hooks: + - id: eslint +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: end-of-file-fixer + - id: trailing-whitespace +- repo: https://github.com/pylint-dev/pylint + rev: v2.17.2 + hooks: + - id: pylint From ac6bceb202ff7292a4b2b30b93e043d4e731019f Mon Sep 17 00:00:00 2001 From: Steffen Zellmer <151627820+Steffen025@users.noreply.github.com> Date: Sun, 12 Apr 2026 02:12:57 +0200 Subject: [PATCH 2/2] fix(ci): coderabbit round 2 + add release-please for v3.0 automated releases MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CodeRabbit round 2 fixes (5 findings, all valid): 1. ci.yml + code-quality.yml: pin bun-version from 'latest' to '1.x' to prevent non-deterministic builds if Bun 2.x ships a breaking change. '1.x' resolves to the latest 1.x patch (currently 1.3.10), giving reproducibility without requiring manual version bumps on every Bun patch release. 2. .pre-commit-config.yaml: add check-yaml, check-json, check-merge-conflict hooks to the existing pre-commit-hooks block. These baseline guards catch malformed config files and accidental merge conflict markers before they reach CI. 3. upstream-sync-opencode.yml: add persist-credentials: false to the 'Checkout fork' step. Prevents the checked-out UPSTREAM_SYNC_TOKEN from being persisted in the workspace after checkout, reducing the token's blast radius if a subsequent step is compromised. 4. scorecards.yml: narrow top-level permissions from 'read-all' to 'permissions: contents: read'. The job-level block already grants the specific scopes the Scorecard analysis job actually needs (security-events: write, id-token: write, etc.). The broad 'read-all' at workflow level was unnecessary and over-privileged. Release automation — release-please (ships alongside this PR): Three files added to enable automated GitHub Releases + CHANGELOG updates using Google's release-please-action v4: - release-please-config.json: release-type 'node' (updates package.json version on each release), changelog-path CHANGELOG.md, minor/patch bumping enabled pre-1.0. - .release-please-manifest.json: baseline version {'.' : '3.0.0'} so the first automated release will be v3.0.x or higher — not v1.0.0. - .github/workflows/release-please.yml: triggers on push to main, creates/updates a 'Release PR' that accumulates all conventional commits. Merging the PR creates the GitHub Release, updates CHANGELOG.md, and bumps package.json. No Node.js setup step needed (pure GitHub Action). Conventional commit → SemVer mapping (no changes needed to commit style): feat(scope): → minor bump (v3.x.0 → v3.(x+1).0) fix(scope): → patch bump (v3.0.x → v3.0.(x+1)) feat!: / BREAKING CHANGE: → major bump (v3.x.0 → v4.0.0) chore: / docs: / refactor: → no release PR Also: - package.json version: 2.0.0 → 3.0.0 (aligned with manifest baseline) - CHANGELOG.md: [3.0.0] - Unreleased → [3.0.0] - 2026-04-12 (ready to ship; release-please will own CHANGELOG formatting from v3.0.1 onward) --- .github/workflows/ci.yml | 2 +- .github/workflows/code-quality.yml | 2 +- .github/workflows/release-please.yml | 27 ++++++++++++++++++++ .github/workflows/scorecards.yml | 5 ++-- .github/workflows/upstream-sync-opencode.yml | 1 + .pre-commit-config.yaml | 3 +++ .release-please-manifest.json | 3 +++ CHANGELOG.md | 2 +- package.json | 2 +- release-please-config.json | 13 ++++++++++ 10 files changed, 54 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/release-please.yml create mode 100644 .release-please-manifest.json create mode 100644 release-please-config.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 25123f0f..2474ab56 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,7 +32,7 @@ jobs: - name: Setup Bun uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 with: - bun-version: latest + bun-version: "1.x" # pin to major — avoids breaking changes from Bun 2.x - name: Install dependencies run: bun install diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml index 302a9950..dcf3067e 100644 --- a/.github/workflows/code-quality.yml +++ b/.github/workflows/code-quality.yml @@ -26,7 +26,7 @@ jobs: - name: Setup Bun uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 with: - bun-version: latest + bun-version: "1.x" # pin to major — avoids breaking changes from Bun 2.x - name: Install dependencies run: bun install --frozen-lockfile diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 00000000..9a411aac --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,27 @@ +name: Release Please + +on: + push: + branches: + - main + +permissions: + contents: write + pull-requests: write + +jobs: + release-please: + name: Release Please + runs-on: ubuntu-latest + steps: + - name: Harden the runner (Audit all outbound calls) + uses: step-security/harden-runner@f808768d1510423e83855289c910610ca9b43176 # v2.17.0 + with: + egress-policy: audit + + - uses: googleapis/release-please-action@v4 + id: release + with: + token: ${{ secrets.GITHUB_TOKEN }} + config-file: release-please-config.json + manifest-file: .release-please-manifest.json diff --git a/.github/workflows/scorecards.yml b/.github/workflows/scorecards.yml index 6803b807..fe56191c 100644 --- a/.github/workflows/scorecards.yml +++ b/.github/workflows/scorecards.yml @@ -14,8 +14,9 @@ on: push: branches: ["main"] -# Declare default permissions as read only. -permissions: read-all +# Minimal default permissions — job-level block grants what's actually needed. +permissions: + contents: read jobs: analysis: diff --git a/.github/workflows/upstream-sync-opencode.yml b/.github/workflows/upstream-sync-opencode.yml index 83b2ecf4..17a1b064 100644 --- a/.github/workflows/upstream-sync-opencode.yml +++ b/.github/workflows/upstream-sync-opencode.yml @@ -42,6 +42,7 @@ jobs: repository: ${{ env.FORK_REPO }} token: ${{ secrets.UPSTREAM_SYNC_TOKEN }} fetch-depth: 0 + persist-credentials: false - name: Fetch upstream run: | diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 66d4c9be..6b855722 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,6 +16,9 @@ repos: hooks: - id: end-of-file-fixer - id: trailing-whitespace + - id: check-yaml + - id: check-json + - id: check-merge-conflict - repo: https://github.com/pylint-dev/pylint rev: v2.17.2 hooks: diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 00000000..d4f6f299 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "3.0.0" +} diff --git a/CHANGELOG.md b/CHANGELOG.md index 119d5ee5..57180991 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 --- -## [3.0.0] - Unreleased +## [3.0.0] - 2026-04-12 ### ⚠️ Breaking Changes diff --git a/package.json b/package.json index 19b2bdf6..900a3e47 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pai-opencode", - "version": "2.0.0", + "version": "3.0.0", "description": "Personal AI Infrastructure for OpenCode (based on PAI v3.0, Algorithm v1.8.0)", "type": "module", "scripts": { diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 00000000..9961c874 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,13 @@ +{ + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", + "release-type": "node", + "packages": { + ".": { + "changelog-path": "CHANGELOG.md", + "bump-minor-pre-major": true, + "bump-patch-for-minor-pre-major": true, + "draft": false, + "prerelease": false + } + } +}