diff --git a/.github/labeler.yml b/.github/labeler.yml index bc167d670..79ceea73a 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -202,55 +202,3 @@ style: test: - head-branch: ["^.*/test/.*", "test"] - -# ============================================================================== -# RELEASE PLEASE LABELS -# ============================================================================== -# Automatically label release PRs created by release-please. -# Branch pattern: release-please---- - -release: - - head-branch: ["^release-please--.*"] - -# Component-specific release labels -release/dotprompt: - - head-branch: ["^release-please--dotprompt.*"] - -release/dotpromptz: - - head-branch: ["^release-please--dotpromptz--.*"] - -release/dotpromptz-handlebars: - - head-branch: ["^release-please--dotpromptz-handlebars--.*"] - -release/dotprompt-go: - - head-branch: ["^release-please--dotprompt-go.*"] - -release/dotprompt-rs: - - head-branch: ["^release-please--dotprompt-rs.*"] - -release/dotprompt-java: - - head-branch: ["^release-please--dotprompt-java.*"] - -release/vscode: - - head-branch: ["^release-please--dotprompt-vscode.*"] - -release/vim: - - head-branch: ["^release-please--dotprompt-vim.*"] - -release/emacs: - - head-branch: ["^release-please--dotprompt-emacs.*"] - -release/jetbrains: - - head-branch: ["^release-please--dotprompt-jetbrains.*"] - -release/monaco: - - head-branch: ["^release-please--dotprompt-monaco.*"] - -release/codemirror: - - head-branch: ["^release-please--dotprompt-codemirror.*"] - -release/treesitter: - - head-branch: ["^release-please--tree-sitter-dotprompt.*"] - -release/promptly: - - head-branch: ["^release-please--promptly.*"] diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index d208efad6..2ee29920b 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -23,8 +23,7 @@ on: branches: [ main ] permissions: - contents: write - pull-requests: write + contents: read jobs: build_and_test: @@ -39,9 +38,6 @@ jobs: steps: - name: Checkout Code uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 - with: - ref: ${{ startsWith(github.head_ref, 'release-please--') && github.head_ref || '' }} - token: ${{ startsWith(github.head_ref, 'release-please--') && secrets.RELEASE_PLEASE_TOKEN || github.token }} # Bazel needs a JDK. Setup Java from matrix. - name: Setup Java JDK ${{ matrix.java-version }} @@ -63,35 +59,10 @@ jobs: repository-cache: true cache-save: true - - name: Check if this is a release-please PR - id: check-release-please - run: | - if [[ "${GITHUB_HEAD_REF}" == release-please--* ]]; then - echo "is_release_please=true" >> $GITHUB_OUTPUT - else - echo "is_release_please=false" >> $GITHUB_OUTPUT - fi - - name: Pin Java dependencies run: bazelisk run @maven//:pin - - name: Commit maven_install.json updates for release-please PR - if: steps.check-release-please.outputs.is_release_please == 'true' && matrix.java-version == 17 - run: | - # Use CLA-covered maintainer identity from MAINTAINERS.yaml - git config user.name "$(yq '.ci.commit_author.name' MAINTAINERS.yaml)" - git config user.email "$(yq '.ci.commit_author.email' MAINTAINERS.yaml)" - if ! git diff --quiet maven_install.json; then - git add maven_install.json - git commit -m "chore: update maven_install.json" - git push - echo "maven_install.json updated and pushed" - else - echo "No maven_install.json changes needed" - fi - - name: Check for changes in maven_install.json - if: steps.check-release-please.outputs.is_release_please != 'true' id: git-check run: | if [[ -n "$(git status --porcelain maven_install.json)" ]]; then diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index 55a251e4d..19d16c259 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -29,12 +29,12 @@ jobs: outputs: any_changed: ${{ steps.changed-files.outputs.any_changed }} steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 with: fetch-depth: 0 - name: Get changed files id: changed-files - uses: tj-actions/changed-files@v45 + uses: tj-actions/changed-files@9426d40962ed5378910ee2e21d5f8c6fcbf2dd96 # v47.0.6 with: files: | dart/** @@ -48,10 +48,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v6 + uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 - name: Setup Dart - uses: dart-lang/setup-dart@v1 + uses: dart-lang/setup-dart@2286a0c042b44434fe26d292bbce8d34f7ec662b # v1.8.2 with: sdk: stable @@ -70,10 +70,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v6 + uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 - name: Setup Dart - uses: dart-lang/setup-dart@v1 + uses: dart-lang/setup-dart@2286a0c042b44434fe26d292bbce8d34f7ec662b # v1.8.2 with: sdk: stable @@ -97,10 +97,10 @@ jobs: sdk: [stable, beta] steps: - name: Checkout code - uses: actions/checkout@v6 + uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 - name: Setup Dart - uses: dart-lang/setup-dart@v1 + uses: dart-lang/setup-dart@2286a0c042b44434fe26d292bbce8d34f7ec662b # v1.8.2 with: sdk: ${{ matrix.sdk }} @@ -126,10 +126,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v6 + uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 - name: Setup Java (required for ANTLR) - uses: actions/setup-java@v4 + uses: actions/setup-java@cf277c60eb25467037889841efdb72551f06f6c3 # v4.9.1 with: distribution: "temurin" java-version: "17" diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index d2e111ac4..d84dda7d6 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -29,17 +29,15 @@ on: # Allow this job to clone the repo and create a page deployment permissions: contents: read - pages: write - id-token: write jobs: build: runs-on: ubuntu-latest steps: - name: Checkout your repository using git - uses: actions/checkout@v6 + uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 - name: Install, build, and upload your site - uses: withastro/action@v3 + uses: withastro/action@56781b97402ce0487b7e61ce2cb960c0e2cc5289 # v3.0.2 with: path: third_party/docsite node-version: 22 @@ -48,10 +46,13 @@ jobs: deploy: needs: build runs-on: ubuntu-latest + permissions: + pages: write + id-token: write environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v4 + uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5 diff --git a/.github/workflows/engdoc.yml b/.github/workflows/engdoc.yml index 9cbc1b6a0..2387d6f7f 100644 --- a/.github/workflows/engdoc.yml +++ b/.github/workflows/engdoc.yml @@ -16,6 +16,9 @@ name: Eng Documentation Checks +permissions: + contents: read + on: pull_request: branches: [ main ] @@ -26,12 +29,12 @@ jobs: outputs: any_changed: ${{ steps.changed-files.outputs.any_changed }} steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 with: fetch-depth: 0 - name: Get changed files id: changed-files - uses: tj-actions/changed-files@v45 + uses: tj-actions/changed-files@9426d40962ed5378910ee2e21d5f8c6fcbf2dd96 # v47.0.6 with: files: | docs/** @@ -53,7 +56,7 @@ jobs: fail-fast: false steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 - name: Install system dependencies run: | @@ -61,22 +64,22 @@ jobs: sudo apt-get install -y build-essential libffi-dev cmake curl ripgrep - name: Install Rust - uses: dtolnay/rust-toolchain@stable + uses: dtolnay/rust-toolchain@39008827e6b4319a349e9a42dfc90579dd25f1ca # stable with: components: rustfmt, clippy env: RUSTUP_MAX_RETRIES: 3 - name: Setup sccache - uses: mozilla-actions/sccache-action@v0.0.9 + uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9 - name: Set up Go - uses: actions/setup-go@v6 + uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0 with: go-version: stable - name: Install uv and setup Python version - uses: astral-sh/setup-uv@v5 + uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5.4.2 with: enable-cache: true python-version: ${{ matrix.python-version }} diff --git a/.github/workflows/flutter.yml b/.github/workflows/flutter.yml index e2e52c2d7..87e0e22f8 100644 --- a/.github/workflows/flutter.yml +++ b/.github/workflows/flutter.yml @@ -31,12 +31,12 @@ jobs: outputs: any_changed: ${{ steps.changed-files.outputs.any_changed }} steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 with: fetch-depth: 0 - name: Get changed files id: changed-files - uses: tj-actions/changed-files@v45 + uses: tj-actions/changed-files@9426d40962ed5378910ee2e21d5f8c6fcbf2dd96 # v47.0.6 with: files: | bazel/rules_flutter/** @@ -54,10 +54,10 @@ jobs: os: [ubuntu-latest, macos-latest] steps: - name: Checkout code - uses: actions/checkout@v6 + uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 - name: Setup Bazel - uses: bazel-contrib/setup-bazel@0.18.0 + uses: bazel-contrib/setup-bazel@083175551ceeceebc757ebee2127fde78840ca77 # 0.18.0 with: bazelisk-cache: true disk-cache: ${{ github.workflow }}-${{ matrix.os }} @@ -78,7 +78,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v6 + uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 - name: Install buildifier run: | @@ -107,28 +107,25 @@ jobs: os: [ubuntu-latest, macos-latest] steps: - name: Checkout code - uses: actions/checkout@v6 + uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 - name: Setup Flutter - uses: subosito/flutter-action@v2 + uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2 # v2.23.0 with: flutter-version: '3.27.0' channel: 'stable' cache: true - name: Setup Dart - uses: dart-lang/setup-dart@v1 + uses: dart-lang/setup-dart@2286a0c042b44434fe26d292bbce8d34f7ec662b # v1.8.2 with: sdk: stable - name: Install protoc - uses: arduino/setup-protoc@v3 + uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0 with: version: '28.x' - - name: Install protoc-gen-dart - run: dart pub global activate protoc_plugin - - name: Setup gRPC example working-directory: bazel/rules_flutter/examples/grpc_app run: | @@ -139,11 +136,15 @@ jobs: # Add platform support flutter create --platforms=web,linux . 2>/dev/null || true - # Generate proto files + # Generate proto files. The client is pinned to protobuf 4.x (Flutter 3.27 / + # Dart 3.6) and the server to protobuf 6.0.x (see the pubspec.lock files), so + # each gets code from the matching protoc_plugin release instead of sharing one. mkdir -p lib/generated server/lib/generated export PATH="$HOME/.pub-cache/bin:$PATH" + dart pub global activate protoc_plugin 22.4.0 protoc --dart_out=grpc:lib/generated -Iproto proto/helloworld.proto - cp lib/generated/*.dart server/lib/generated/ + dart pub global activate protoc_plugin 25.0.0 + protoc --dart_out=grpc:server/lib/generated -Iproto proto/helloworld.proto - name: Analyze Flutter client working-directory: bazel/rules_flutter/examples/grpc_app @@ -181,7 +182,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v6 + uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 - name: Validate Envoy config syntax working-directory: bazel/rules_flutter/examples/grpc_app/proxy @@ -239,10 +240,10 @@ jobs: runs-on: windows-latest steps: - name: Checkout code - uses: actions/checkout@v6 + uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 - name: Setup Bazel - uses: bazel-contrib/setup-bazel@0.18.0 + uses: bazel-contrib/setup-bazel@083175551ceeceebc757ebee2127fde78840ca77 # 0.18.0 with: bazelisk-cache: true disk-cache: ${{ github.workflow }}-windows diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 6dec13d95..07c55a595 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -21,8 +21,7 @@ on: branches: [ main ] permissions: - contents: write - pull-requests: write + contents: read jobs: check-paths: @@ -30,12 +29,12 @@ jobs: outputs: any_changed: ${{ steps.changed-files.outputs.any_changed }} steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 with: fetch-depth: 0 - name: Get changed files id: changed-files - uses: tj-actions/changed-files@v45 + uses: tj-actions/changed-files@9426d40962ed5378910ee2e21d5f8c6fcbf2dd96 # v47.0.6 with: files: | go/** @@ -49,47 +48,13 @@ jobs: name: go.sum Check steps: - name: Checkout Repo - uses: actions/checkout@v6 - with: - ref: ${{ github.head_ref }} - token: ${{ secrets.RELEASE_PLEASE_TOKEN || github.token }} + uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 - name: Set up Go - uses: actions/setup-go@v6 + uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0 with: go-version: stable - - name: Check if this is a release-please PR - id: check-release-please - run: | - if [[ "${GITHUB_HEAD_REF}" == release-please--* ]]; then - echo "is_release_please=true" >> $GITHUB_OUTPUT - else - echo "is_release_please=false" >> $GITHUB_OUTPUT - fi - - - name: Update go.sum for release-please PR - if: steps.check-release-please.outputs.is_release_please == 'true' - working-directory: go - run: | - echo "Updating go.sum for release-please PR..." - go mod tidy - - - name: Commit go.sum updates - if: steps.check-release-please.outputs.is_release_please == 'true' - run: | - # Use CLA-covered maintainer identity from MAINTAINERS.yaml - git config user.name "$(yq '.ci.commit_author.name' MAINTAINERS.yaml)" - git config user.email "$(yq '.ci.commit_author.email' MAINTAINERS.yaml)" - if ! git diff --quiet go/go.sum go/go.mod; then - git add go/go.sum go/go.mod - git commit -m "chore: update go.mod and go.sum" - git push - echo "go.sum updated and pushed" - else - echo "No go.sum changes needed" - fi - - name: Check go.mod and go.sum are tidy working-directory: go run: | @@ -108,10 +73,10 @@ jobs: name: Go Format Check steps: - name: Checkout Repo - uses: actions/checkout@v6 + uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 - name: Set up Go - uses: actions/setup-go@v6 + uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0 with: go-version: stable @@ -139,15 +104,17 @@ jobs: name: Go ${{ matrix.go-version }} Tests steps: - name: Checkout Repo - uses: actions/checkout@v6 + uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 - name: Set up Go ${{ matrix.go-version }} - uses: actions/setup-go@v6 + uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0 with: go-version: ${{ matrix.go-version }} - name: Install govulncheck - run: go install golang.org/x/vuln/cmd/govulncheck@latest + # v1.7.0 is the last release that builds on Go 1.25 (v1.8.0+ require Go 1.26). + # The vulnerability database is fetched at run time, so pinning doesn't age the scan. + run: go install golang.org/x/vuln/cmd/govulncheck@v1.7.0 - name: Check build run: go build -C go -v ./... diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 3c94bb34d..7ea63d598 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -32,12 +32,12 @@ jobs: outputs: any_changed: ${{ steps.changed-files.outputs.any_changed }} steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 with: fetch-depth: 0 - name: Get changed files id: changed-files - uses: tj-actions/changed-files@v45 + uses: tj-actions/changed-files@9426d40962ed5378910ee2e21d5f8c6fcbf2dd96 # v47.0.6 with: files: | go/** @@ -49,14 +49,14 @@ jobs: name: lint runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 - - uses: actions/setup-go@v6 + - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 + - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0 with: go-version: stable - name: golangci-lint - uses: golangci/golangci-lint-action@v7 + uses: golangci/golangci-lint-action@9fae48acfc02a90574d7c304a1758ef9895495fa # v7.0.1 with: - version: v2.10.1 + version: v2.15.0 working-directory: go golangci-lint-all: diff --git a/.github/workflows/ide_plugins.yml b/.github/workflows/ide_plugins.yml index 95d0a0a0f..295dba850 100644 --- a/.github/workflows/ide_plugins.yml +++ b/.github/workflows/ide_plugins.yml @@ -16,6 +16,9 @@ name: IDE Plugins +permissions: + contents: read + on: push: branches: [main] @@ -29,12 +32,12 @@ jobs: outputs: any_changed: ${{ steps.changed-files.outputs.any_changed }} steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 with: fetch-depth: 0 - name: Get changed files id: changed-files - uses: tj-actions/changed-files@v45 + uses: tj-actions/changed-files@9426d40962ed5378910ee2e21d5f8c6fcbf2dd96 # v47.0.6 with: files: | packages/jetbrains/** @@ -48,16 +51,16 @@ jobs: name: JetBrains Plugin runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 - name: Setup Java - uses: actions/setup-java@v4 + uses: actions/setup-java@cf277c60eb25467037889841efdb72551f06f6c3 # v4.9.1 with: distribution: 'zulu' java-version: '17' - name: Setup Gradle - uses: gradle/actions/setup-gradle@v3 + uses: gradle/actions/setup-gradle@d9c87d481d55275bb5441eef3fe0e46805f9ef70 # v3.5.0 with: gradle-version: 8.5 @@ -85,7 +88,7 @@ jobs: name: Vim/Neovim runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 - name: Check Lua formatting run: ./scripts/format_lua_files --check @@ -96,10 +99,10 @@ jobs: name: Emacs Mode runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 - name: Setup Emacs - uses: purcell/setup-emacs@master + uses: purcell/setup-emacs@34c6ded44899fd1bf74d2889558befd1750e61a7 # master with: version: 29.1 diff --git a/.github/workflows/java.yml b/.github/workflows/java.yml index c07b9d275..ff3e6323b 100644 --- a/.github/workflows/java.yml +++ b/.github/workflows/java.yml @@ -16,6 +16,9 @@ name: Java checks +permissions: + contents: read + on: push: branches: @@ -29,12 +32,12 @@ jobs: outputs: any_changed: ${{ steps.changed-files.outputs.any_changed }} steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 with: fetch-depth: 0 - name: Get changed files id: changed-files - uses: tj-actions/changed-files@v45 + uses: tj-actions/changed-files@9426d40962ed5378910ee2e21d5f8c6fcbf2dd96 # v47.0.6 with: files: | java/** @@ -47,10 +50,10 @@ jobs: runs-on: ubuntu-latest name: Java Format Check steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 - name: Set up JDK 21 - uses: actions/setup-java@v5 + uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5.7.0 with: java-version: '21' distribution: 'temurin' @@ -83,16 +86,16 @@ jobs: name: Java ${{ matrix.java-version }} Tests steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 - name: Set up JDK ${{ matrix.java-version }} - uses: actions/setup-java@v5 + uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5.7.0 with: java-version: ${{ matrix.java-version }} distribution: 'temurin' - name: Setup Bazel - uses: bazel-contrib/setup-bazel@0.18.0 + uses: bazel-contrib/setup-bazel@083175551ceeceebc757ebee2127fde78840ca77 # 0.18.0 with: bazelisk-cache: true disk-cache: ${{ github.workflow }}-java${{ matrix.java-version }} diff --git a/.github/workflows/js.yml b/.github/workflows/js.yml index 92a545180..139e897d7 100644 --- a/.github/workflows/js.yml +++ b/.github/workflows/js.yml @@ -21,8 +21,7 @@ on: branches: [ main ] permissions: - contents: write - pull-requests: write + contents: read jobs: check-paths: @@ -30,12 +29,12 @@ jobs: outputs: any_changed: ${{ steps.changed-files.outputs.any_changed }} steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 with: fetch-depth: 0 - name: Get changed files id: changed-files - uses: tj-actions/changed-files@v45 + uses: tj-actions/changed-files@9426d40962ed5378910ee2e21d5f8c6fcbf2dd96 # v47.0.6 with: files: | js/** @@ -51,48 +50,15 @@ jobs: runs-on: ubuntu-latest name: pnpm-lock.yaml Check steps: - - uses: actions/checkout@v6 - with: - ref: ${{ github.head_ref }} - token: ${{ secrets.RELEASE_PLEASE_TOKEN || github.token }} + - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 - name: Setup Node.js - uses: actions/setup-node@v6 + uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 with: node-version: "22" - name: Install pnpm - uses: pnpm/action-setup@v4 - - - name: Check if this is a release-please PR - id: check-release-please - run: | - if [[ "${GITHUB_HEAD_REF}" == release-please--* ]]; then - echo "is_release_please=true" >> $GITHUB_OUTPUT - else - echo "is_release_please=false" >> $GITHUB_OUTPUT - fi - - - name: Update lockfiles for release-please PR - if: steps.check-release-please.outputs.is_release_please == 'true' - run: | - echo "Updating pnpm-lock.yaml for release-please PR..." - pnpm install --lockfile-only - - - name: Commit lockfile updates - if: steps.check-release-please.outputs.is_release_please == 'true' - run: | - # Use CLA-covered maintainer identity from MAINTAINERS.yaml - git config user.name "$(yq '.ci.commit_author.name' MAINTAINERS.yaml)" - git config user.email "$(yq '.ci.commit_author.email' MAINTAINERS.yaml)" - if ! git diff --quiet pnpm-lock.yaml js/pnpm-lock.yaml; then - git add pnpm-lock.yaml js/pnpm-lock.yaml 2>/dev/null || true - git commit -m "chore: update pnpm lockfiles" || echo "No changes to commit" - git push || echo "Nothing to push" - echo "Lockfiles updated and pushed" - else - echo "No lockfile changes needed" - fi + uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0 - name: Check pnpm-lock.yaml is up to date run: | @@ -105,21 +71,22 @@ jobs: runs-on: ubuntu-latest name: JS/TS Format Check steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 - name: Setup Node.js - uses: actions/setup-node@v6 + uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 with: node-version: "22" - name: Install pnpm - uses: pnpm/action-setup@v4 + uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0 - name: Install dependencies run: pnpm -C js install - name: Check formatting with Biome - run: pnpm dlx @biomejs/biome check --formatter-enabled=true --linter-enabled=false js/ + # Pinned to match biome.json's $schema; unpinned dlx picks up new formatter rules. + run: pnpm dlx @biomejs/biome@2.3.15 check --formatter-enabled=true --linter-enabled=false js/ test: name: Run tests (Node ${{ matrix.node-version }}, ${{ matrix.typescript-compiler }}) @@ -131,15 +98,15 @@ jobs: node-version: ["20", "21", "22", "23", "24"] typescript-compiler: ["tsc", "tsgo"] steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 - name: Setup Node.js v${{ matrix.node-version }} - uses: actions/setup-node@v6 + uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 with: node-version: ${{ matrix.node-version }} - name: Install pnpm - uses: pnpm/action-setup@v4 + uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0 - name: Install dependencies run: pnpm -C js install diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index c7b0d3fc7..80c25d76c 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -16,6 +16,9 @@ name: "Pull Request Labeler" +permissions: + contents: read + on: - pull_request_target @@ -26,4 +29,4 @@ jobs: pull-requests: write runs-on: ubuntu-latest steps: - - uses: actions/labeler@v6 + - uses: actions/labeler@b8dd2d9be0f68b860e7dae5dae7d772984eacd6d # v6.2.0 diff --git a/.github/workflows/promptly-npm.yml b/.github/workflows/promptly-npm.yml index 5a66efc1c..eebba59ba 100644 --- a/.github/workflows/promptly-npm.yml +++ b/.github/workflows/promptly-npm.yml @@ -16,6 +16,9 @@ name: Promptly npm Packages +permissions: + contents: read + on: push: tags: @@ -38,10 +41,6 @@ jobs: build: name: Build ${{ matrix.target }} runs-on: ${{ matrix.os }} - env: - # Enable sccache for Rust builds (disabled on macos-15-intel due to missing binaries) - SCCACHE_GHA_ENABLED: ${{ matrix.os != 'macos-15-intel' && 'true' || 'false' }} - RUSTC_WRAPPER: ${{ matrix.os != 'macos-15-intel' && 'sccache' || '' }} strategy: fail-fast: false matrix: @@ -64,19 +63,17 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + with: + persist-credentials: false - name: Install Rust - uses: dtolnay/rust-toolchain@stable + uses: dtolnay/rust-toolchain@39008827e6b4319a349e9a42dfc90579dd25f1ca # stable with: targets: ${{ matrix.target }} env: RUSTUP_MAX_RETRIES: 3 - - name: Setup sccache - if: matrix.os != 'macos-15-intel' - uses: mozilla-actions/sccache-action@v0.0.9 - - name: Build run: cargo build --release --package promptly --target ${{ matrix.target }} @@ -94,7 +91,7 @@ jobs: Copy-Item target/${{ matrix.target }}/release/promptly.exe packages/${{ matrix.npm_package }}/bin/ - name: Upload artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: ${{ matrix.npm_package }} path: packages/${{ matrix.npm_package }} @@ -107,16 +104,19 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + with: + persist-credentials: false - name: Setup Node.js - uses: actions/setup-node@v4 + uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 with: node-version: "20" registry-url: "https://registry.npmjs.org" + package-manager-cache: false - name: Download all artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 with: path: artifacts diff --git a/.github/workflows/publish_java.yml b/.github/workflows/publish_java.yml index 5e1c7b5e7..7e2af139c 100644 --- a/.github/workflows/publish_java.yml +++ b/.github/workflows/publish_java.yml @@ -29,6 +29,9 @@ name: Publish Java Package # - Ensure the key has no empty lines or formatting issues when pasted into GitHub Secrets. # +permissions: + contents: read + on: release: types: [created] @@ -41,16 +44,16 @@ jobs: permissions: contents: read steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 - name: Set up JDK 21 - uses: actions/setup-java@v5 + uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5.7.0 with: java-version: '21' distribution: 'temurin' - name: Setup Bazel - uses: bazel-contrib/setup-bazel@0.18.0 + uses: bazel-contrib/setup-bazel@083175551ceeceebc757ebee2127fde78840ca77 # 0.18.0 with: bazelisk-cache: true disk-cache: ${{ github.workflow }} @@ -60,7 +63,7 @@ jobs: - name: Import GPG key id: import_gpg - uses: crazy-max/ghaction-import-gpg@v6 + uses: crazy-max/ghaction-import-gpg@e89d40939c28e39f97cf32126055eeae86ba74ec # v6.3.0 with: gpg_private_key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} passphrase: ${{ secrets.MAVEN_GPG_PASSPHRASE }} diff --git a/.github/workflows/publish_python_handlebarrz_package.yml b/.github/workflows/publish_python_handlebarrz_package.yml index 3bdfa5eb0..934b9a12f 100644 --- a/.github/workflows/publish_python_handlebarrz_package.yml +++ b/.github/workflows/publish_python_handlebarrz_package.yml @@ -71,6 +71,8 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5.4.2 + with: + enable-cache: false - name: Build working-directory: python diff --git a/.github/workflows/publish_rust.yml b/.github/workflows/publish_rust.yml index 6df5630d4..79a9381e8 100644 --- a/.github/workflows/publish_rust.yml +++ b/.github/workflows/publish_rust.yml @@ -16,6 +16,9 @@ name: Publish Rust Package +permissions: + contents: read + on: release: types: [created] @@ -29,10 +32,10 @@ jobs: contents: read steps: - name: Checkout code - uses: actions/checkout@v6 + uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@stable + uses: dtolnay/rust-toolchain@39008827e6b4319a349e9a42dfc90579dd25f1ca # stable env: RUSTUP_MAX_RETRIES: 3 diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 6f709e6ff..ad0ff6018 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -46,55 +46,14 @@ jobs: needs: check-paths if: needs.check-paths.outputs.any_changed == 'true' runs-on: ubuntu-latest - permissions: - contents: write - pull-requests: write steps: - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 - with: - # Only check out head_ref directly on release-please branches that push commits back; - # fork PRs do not have a matching branch ref on the base repository. - ref: ${{ startsWith(github.head_ref, 'release-please--') && github.head_ref || '' }} - # Use a token that can push to the branch (for release-please PRs) - token: ${{ startsWith(github.head_ref, 'release-please--') && secrets.RELEASE_PLEASE_TOKEN || github.token }} - name: Install uv uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5.4.2 with: enable-cache: true - - name: Check if this is a release-please PR - id: check-release-please - run: | - if [[ "${GITHUB_HEAD_REF}" == release-please--* ]]; then - echo "is_release_please=true" >> $GITHUB_OUTPUT - else - echo "is_release_please=false" >> $GITHUB_OUTPUT - fi - - - name: Update lockfiles for release-please PR - if: steps.check-release-please.outputs.is_release_please == 'true' - working-directory: python - run: | - echo "Updating uv.lock for release-please PR..." - uv lock - ../scripts/export_requirements - - - name: Commit lockfile updates - if: steps.check-release-please.outputs.is_release_please == 'true' - run: | - # Use CLA-covered maintainer identity from MAINTAINERS.yaml - git config user.name "$(yq '.ci.commit_author.name' MAINTAINERS.yaml)" - git config user.email "$(yq '.ci.commit_author.email' MAINTAINERS.yaml)" - if ! git diff --quiet python/uv.lock python/requirements.txt; then - git add python/uv.lock python/requirements.txt - git commit -m "chore: update Python lockfiles" - git push - echo "Lockfiles updated and pushed" - else - echo "No lockfile changes needed" - fi - - name: Check uv.lock is up to date working-directory: python run: | diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml deleted file mode 100644 index 53e5f7c3a..000000000 --- a/.github/workflows/release-please.yml +++ /dev/null @@ -1,145 +0,0 @@ -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# SPDX-License-Identifier: Apache-2.0 - -name: Release Please - -on: - push: - branches: - - main - workflow_dispatch: - -permissions: - contents: read - -jobs: - release-please: - runs-on: ubuntu-latest - permissions: - contents: write - pull-requests: write - outputs: - releases_created: ${{ steps.release.outputs.releases_created }} - prs_created: ${{ steps.release.outputs.prs_created }} - prs: ${{ steps.release.outputs.prs }} - dotpromptz_release_created: ${{ steps.release.outputs['dotpromptz--release_created'] }} - handlebars_release_created: ${{ steps.release.outputs['dotpromptz-handlebars--release_created'] }} - pr: ${{ steps.release.outputs.pr }} - steps: - - uses: googleapis/release-please-action@5c625bfb5d1ff62eadeeb3772007f7f66fdcf071 # v4 - id: release - with: - token: ${{ secrets.RELEASE_PLEASE_TOKEN }} - config-file: .release-please-config.json - manifest-file: .release-please-manifest.json - - # =========================================================================== - # UPDATE LOCKFILES FOR RELEASE PRs - # =========================================================================== - # This job updates lockfiles (MODULE.bazel.lock, Cargo.lock, etc.) for each - # release PR created by release-please. It uses a matrix strategy to process - # each PR separately since we use separate-pull-requests: true. - - update-lockfiles: - runs-on: ubuntu-latest - permissions: - contents: write - needs: release-please - # Only run if release-please created/updated PRs - if: needs.release-please.outputs.prs != '' && needs.release-please.outputs.prs != '[]' - strategy: - fail-fast: false - matrix: - pr: ${{ fromJson(needs.release-please.outputs.prs) }} - steps: - - name: Checkout PR branch - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 - with: - ref: ${{ matrix.pr.headBranchName }} - token: ${{ secrets.RELEASE_PLEASE_TOKEN }} - - - name: Setup Bazel - uses: bazel-contrib/setup-bazel@083175551ceeceebc757ebee2127fde78840ca77 # 0.18.0 - with: - bazelisk-cache: true - disk-cache: ${{ github.workflow }}-lockfiles - repository-cache: true - cache-save: true - - - name: Install uv - uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5.4.2 - with: - version: "latest" - - - name: Setup Go - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6 - with: - go-version: "1.24.x" - - - name: Setup Node.js - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6 - with: - node-version: 20 - - - name: Install pnpm - uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4 - - - name: Setup Rust - uses: dtolnay/rust-toolchain@89b12181fb390509a0842a86cc55eeb8eb928c1d # master - env: - RUSTUP_MAX_RETRIES: 3 - - - name: Update MODULE.bazel.lock - run: | - bazel mod deps --lockfile_mode=update - - - name: Update Cargo.lock (root) - run: | - cargo update --workspace || echo "Root Cargo.lock update skipped" - - - name: Update Go lockfile - run: | - go mod tidy -C go || echo "Go mod tidy skipped" - - - name: Update uv.lock - working-directory: python - run: | - uv sync || echo "uv sync skipped" - - - name: Update pnpm lockfiles - run: | - pnpm install --lockfile-only || echo "pnpm lockfile update skipped" - - - name: Check for changes - id: changes - run: | - git add -A - if git diff --cached --quiet; then - echo "changed=false" >> $GITHUB_OUTPUT - else - echo "changed=true" >> $GITHUB_OUTPUT - echo "Changes detected:" - git diff --cached --stat - fi - - - name: Commit and push changes - if: steps.changes.outputs.changed == 'true' - run: | - # Use CLA-covered maintainer identity from MAINTAINERS.yaml - git config user.name "$(yq '.ci.commit_author.name' MAINTAINERS.yaml)" - git config user.email "$(yq '.ci.commit_author.email' MAINTAINERS.yaml)" - git commit -m "chore: update lockfiles for ${{ matrix.pr.title }}" - git push diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 71730faec..19afbe6d6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,6 +16,9 @@ name: Release JS +permissions: + contents: read + on: workflow_dispatch: inputs: @@ -33,10 +36,10 @@ jobs: name: Run build tasks runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 - - uses: pnpm/action-setup@v4 + - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 + - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0 - name: Set up node v21 - uses: actions/setup-node@v6 + uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 with: node-version: 21.x cache: 'pnpm' @@ -54,7 +57,7 @@ jobs: working-directory: ./js run: pnpm test - name: Set up node v21 - uses: actions/setup-node@v6 + uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 with: node-version: 21.x cache: 'pnpm' diff --git a/.github/workflows/rules_dart.yml b/.github/workflows/rules_dart.yml index 09aeb15cd..fcce28232 100644 --- a/.github/workflows/rules_dart.yml +++ b/.github/workflows/rules_dart.yml @@ -16,6 +16,9 @@ name: Rules Dart Tests +permissions: + contents: read + on: push: branches: [ main ] @@ -41,10 +44,12 @@ jobs: shell: bash steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + with: + persist-credentials: false - name: Setup Bazel - uses: bazel-contrib/setup-bazel@0.18.0 + uses: bazel-contrib/setup-bazel@083175551ceeceebc757ebee2127fde78840ca77 # 0.18.0 with: bazelisk-cache: true disk-cache: ${{ github.workflow }}-${{ matrix.os }} diff --git a/.github/workflows/rules_dart_rbe.yml b/.github/workflows/rules_dart_rbe.yml index 4c82b26a8..1383e7bc8 100644 --- a/.github/workflows/rules_dart_rbe.yml +++ b/.github/workflows/rules_dart_rbe.yml @@ -16,6 +16,9 @@ name: Dart Rules - RBE Testing +permissions: + contents: read + on: push: branches: [main] @@ -51,10 +54,12 @@ jobs: runner: macos-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + with: + persist-credentials: false - name: Set up Bazel - uses: bazel-contrib/setup-bazel@0.18.0 + uses: bazel-contrib/setup-bazel@083175551ceeceebc757ebee2127fde78840ca77 # 0.18.0 with: bazelisk-cache: true disk-cache: ${{ github.workflow }}-${{ matrix.os }} @@ -117,10 +122,12 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + with: + persist-credentials: false - name: Set up Bazel - uses: bazel-contrib/setup-bazel@0.18.0 + uses: bazel-contrib/setup-bazel@083175551ceeceebc757ebee2127fde78840ca77 # 0.18.0 with: bazelisk-cache: true disk-cache: ${{ github.workflow }}-compatibility @@ -170,10 +177,12 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + with: + persist-credentials: false - name: Set up Bazel - uses: bazel-contrib/setup-bazel@0.18.0 + uses: bazel-contrib/setup-bazel@083175551ceeceebc757ebee2127fde78840ca77 # 0.18.0 with: bazelisk-cache: true disk-cache: ${{ github.workflow }}-metrics @@ -215,7 +224,7 @@ jobs: ls -la /tmp/bep.* - name: Upload artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: build-metrics path: | diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index ad59fc4f8..069dbbe40 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -48,15 +48,9 @@ jobs: if: needs.check-paths.outputs.any_changed == 'true' name: Cargo.lock Check runs-on: ubuntu-latest - permissions: - contents: write - pull-requests: write steps: - name: Checkout code uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 - with: - ref: ${{ github.head_ref }} - token: ${{ startsWith(github.head_ref, 'release-please--') && secrets.RELEASE_PLEASE_TOKEN || github.token }} - name: Install Rust toolchain uses: dtolnay/rust-toolchain@7e38f4b43b4db5c8dd498af069a4f6196df1d067 # master @@ -65,36 +59,6 @@ jobs: env: RUSTUP_MAX_RETRIES: 3 - - name: Check if this is a release-please PR - id: check-release-please - run: | - if [[ "${GITHUB_HEAD_REF}" == release-please--* ]]; then - echo "is_release_please=true" >> $GITHUB_OUTPUT - else - echo "is_release_please=false" >> $GITHUB_OUTPUT - fi - - - name: Update Cargo.lock for release-please PR - if: steps.check-release-please.outputs.is_release_please == 'true' - run: | - echo "Updating Cargo.lock for release-please PR..." - cargo update --workspace - - - name: Commit Cargo.lock updates - if: steps.check-release-please.outputs.is_release_please == 'true' - run: | - # Use CLA-covered maintainer identity from MAINTAINERS.yaml - git config user.name "$(yq '.ci.commit_author.name' MAINTAINERS.yaml)" - git config user.email "$(yq '.ci.commit_author.email' MAINTAINERS.yaml)" - if ! git diff --quiet Cargo.lock; then - git add Cargo.lock - git commit -m "chore: update Cargo.lock" - git push - echo "Cargo.lock updated and pushed" - else - echo "No Cargo.lock changes needed" - fi - - name: Check Cargo.lock is up to date run: | cargo check --locked --workspace diff --git a/.github/workflows/todo-check.yml b/.github/workflows/todo-check.yml index 57a2103f9..a071b9a01 100644 --- a/.github/workflows/todo-check.yml +++ b/.github/workflows/todo-check.yml @@ -16,6 +16,9 @@ name: TODO Check +permissions: + contents: read + on: pull_request: branches: [main] @@ -28,7 +31,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + with: + persist-credentials: false - name: Check for TODOs without issue links run: | diff --git a/.github/workflows/treesitter.yml b/.github/workflows/treesitter.yml index 3d8a88ca0..bad889c66 100644 --- a/.github/workflows/treesitter.yml +++ b/.github/workflows/treesitter.yml @@ -16,6 +16,9 @@ name: Tree-sitter +permissions: + contents: read + on: push: branches: [main] @@ -29,12 +32,12 @@ jobs: outputs: any_changed: ${{ steps.changed-files.outputs.any_changed }} steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 with: fetch-depth: 0 - name: Get changed files id: changed-files - uses: tj-actions/changed-files@v45 + uses: tj-actions/changed-files@9426d40962ed5378910ee2e21d5f8c6fcbf2dd96 # v47.0.6 with: files: | packages/treesitter/** @@ -46,10 +49,12 @@ jobs: name: Test and Build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + with: + persist-credentials: false - name: Setup Node - uses: actions/setup-node@v4 + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: node-version: '20' @@ -74,10 +79,12 @@ jobs: contents: write id-token: write steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + with: + persist-credentials: false - name: Setup Node - uses: actions/setup-node@v4 + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: node-version: '20' registry-url: 'https://registry.npmjs.org' diff --git a/.github/workflows/validate-release-please-config.yml b/.github/workflows/validate-release-please-config.yml deleted file mode 100644 index f8c88cf15..000000000 --- a/.github/workflows/validate-release-please-config.yml +++ /dev/null @@ -1,86 +0,0 @@ -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# SPDX-License-Identifier: Apache-2.0 - -name: Validate Release Please Config - -on: - pull_request: - paths: - - ".release-please-config.json" - - ".release-please-manifest.json" - push: - branches: - - main - paths: - - ".release-please-config.json" - - ".release-please-manifest.json" - workflow_dispatch: - -jobs: - validate: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Install uv - uses: astral-sh/setup-uv@v4 - with: - version: "latest" - - - name: Install check-jsonschema - run: uv tool install check-jsonschema - - - name: Validate release-please config - run: | - echo "Validating .release-please-config.json against official schema..." - check-jsonschema \ - --schemafile "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json" \ - .release-please-config.json - - - name: Validate manifest JSON syntax - run: | - echo "Validating .release-please-manifest.json JSON syntax..." - python3 -c "import json; json.load(open('.release-please-manifest.json'))" - - - name: Check manifest keys match config paths - run: | - echo "Checking that manifest keys match config package paths..." - python3 << 'EOF' - import json - import sys - - with open('.release-please-config.json') as f: - config = json.load(f) - - with open('.release-please-manifest.json') as f: - manifest = json.load(f) - - config_paths = set(config.get('packages', {}).keys()) - manifest_paths = set(manifest.keys()) - - # Check for paths in manifest but not in config - extra_in_manifest = manifest_paths - config_paths - if extra_in_manifest: - print(f"❌ Error: Paths in manifest but not in config: {extra_in_manifest}") - sys.exit(1) - - # Check for paths in config but not in manifest (warning only - new packages) - missing_in_manifest = config_paths - manifest_paths - if missing_in_manifest: - print(f"⚠️ Warning: Paths in config but not in manifest (new packages?): {missing_in_manifest}") - - print("✅ Manifest keys match config package paths!") - EOF diff --git a/.github/workflows/vscode_extension.yml b/.github/workflows/vscode_extension.yml index c1fc6befc..cae283ab8 100644 --- a/.github/workflows/vscode_extension.yml +++ b/.github/workflows/vscode_extension.yml @@ -16,6 +16,9 @@ name: "VS Code Extension" +permissions: + contents: read + on: push: branches: [ main ] @@ -28,12 +31,12 @@ jobs: outputs: any_changed: ${{ steps.changed-files.outputs.any_changed }} steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 with: fetch-depth: 0 - name: Get changed files id: changed-files - uses: tj-actions/changed-files@v45 + uses: tj-actions/changed-files@9426d40962ed5378910ee2e21d5f8c6fcbf2dd96 # v47.0.6 with: files: | packages/vscode/** @@ -45,15 +48,15 @@ jobs: name: Build and Package runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 - name: Setup Node.js - uses: actions/setup-node@v6 + uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 with: node-version: 20 - name: Install pnpm - uses: pnpm/action-setup@v4 + uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0 - name: Install dependencies run: pnpm -C packages/vscode install @@ -65,7 +68,7 @@ jobs: run: pnpm -C packages/vscode run package - name: Upload Artifact - uses: actions/upload-artifact@v6 + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 with: name: dotprompt-vscode path: packages/vscode/*.vsix diff --git a/.github/workflows/vscode_publish.yml b/.github/workflows/vscode_publish.yml index e219f3b1d..75d8d3995 100644 --- a/.github/workflows/vscode_publish.yml +++ b/.github/workflows/vscode_publish.yml @@ -16,6 +16,9 @@ name: "VS Code Extension Publish" +permissions: + contents: read + on: release: types: [created] @@ -29,15 +32,16 @@ jobs: name: vscode-marketplace url: https://marketplace.visualstudio.com/items?itemName=Google.dotprompt-vscode steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 - name: Setup Node.js - uses: actions/setup-node@v6 + uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 with: node-version: 20 + package-manager-cache: false - name: Install pnpm - uses: pnpm/action-setup@v4 + uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0 - name: Install dependencies run: pnpm -C packages/vscode install diff --git a/.github/workflows/web_editors.yml b/.github/workflows/web_editors.yml index 781c2fdc7..39ae1f25f 100644 --- a/.github/workflows/web_editors.yml +++ b/.github/workflows/web_editors.yml @@ -16,6 +16,9 @@ name: Web Editor Packages +permissions: + contents: read + on: push: branches: [main] @@ -29,12 +32,12 @@ jobs: outputs: any_changed: ${{ steps.changed-files.outputs.any_changed }} steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 with: fetch-depth: 0 - name: Get changed files id: changed-files - uses: tj-actions/changed-files@v45 + uses: tj-actions/changed-files@9426d40962ed5378910ee2e21d5f8c6fcbf2dd96 # v47.0.6 with: files: | packages/monaco/** @@ -50,15 +53,17 @@ jobs: matrix: package: [monaco, codemirror] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + with: + persist-credentials: false - name: Setup Node - uses: actions/setup-node@v4 + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: node-version: '20' - name: Setup pnpm - uses: pnpm/action-setup@v3 + uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0 with: version: 9 @@ -83,16 +88,18 @@ jobs: contents: write id-token: write steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + with: + persist-credentials: false - name: Setup Node - uses: actions/setup-node@v4 + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: node-version: '20' registry-url: 'https://registry.npmjs.org' - name: Setup pnpm - uses: pnpm/action-setup@v3 + uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0 with: version: 9 diff --git a/go/go.mod b/go/go.mod index 2de64b3ea..eb594569f 100644 --- a/go/go.mod +++ b/go/go.mod @@ -13,7 +13,7 @@ require ( github.com/mbleigh/raymond v0.0.0-20250414171441-6b3a58ab9e0a github.com/pb33f/ordered-map/v2 v2.3.1 github.com/smacker/go-tree-sitter v0.0.0-20240827094217-dd81d9e9be82 - golang.org/x/text v0.36.0 + golang.org/x/text v0.39.0 ) require ( diff --git a/go/go.sum b/go/go.sum index affbe10a4..c48cca78c 100644 --- a/go/go.sum +++ b/go/go.sum @@ -24,7 +24,7 @@ github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= go.yaml.in/yaml/v4 v4.0.0-rc.4 h1:UP4+v6fFrBIb1l934bDl//mmnoIZEDK0idg1+AIvX5U= go.yaml.in/yaml/v4 v4.0.0-rc.4/go.mod h1:aZqd9kCMsGL7AuUv/m/PvWLdg5sjJsZ4oHDEnfPPfY0= -golang.org/x/text v0.36.0 h1:JfKh3XmcRPqZPKevfXVpI1wXPTqbkE5f7JA92a55Yxg= -golang.org/x/text v0.36.0/go.mod h1:NIdBknypM8iqVmPiuco0Dh6P5Jcdk8lJL0CUebqK164= +golang.org/x/text v0.39.0 h1:UbZz4pLOvn600D6Oh6GGEI6VAmndrEBLv8/6BEXzyus= +golang.org/x/text v0.39.0/go.mod h1:3UwRclnC2g0TU9x8PZiyfOajCd1zaUNHF9cvqcQZ+ZM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/python/.pysentry.toml b/python/.pysentry.toml index efa039a1b..3bceaf650 100644 --- a/python/.pysentry.toml +++ b/python/.pysentry.toml @@ -48,7 +48,11 @@ verbose = false color = "auto" [ignore] -ids = [] +# soupsieve is a dev-only transitive dependency (jupyter -> nbconvert -> +# beautifulsoup4), not shipped with dotpromptz. The lock resolves the fixed +# soupsieve 4.x on Python >= 3.11.5; these advisories remain only for the +# older-Python fork (soupsieve 2.10), where no fixed release is installable. +ids = ["GHSA-mmhr-3c5m-f64f", "GHSA-7g44-g9rc-x53w", "GHSA-6655-6qjp-jx7x"] while_no_fix = ["GHSA-xm59-rqc7-hhvf"] patterns = [] packages = [] diff --git a/python/requirements.txt b/python/requirements.txt index 34c0b5da3..c475099c8 100644 --- a/python/requirements.txt +++ b/python/requirements.txt @@ -1739,9 +1739,13 @@ six==1.17.0 ; python_full_version >= '3.11' \ # via # python-dateutil # rfc3339-validator -soupsieve==2.9.2 ; python_full_version >= '3.11' \ - --hash=sha256:4a55d8cf158a9c2e587fa4922f1bbb91d68ac829e2d6f25403a85747c71daf74 \ - --hash=sha256:8089a26fd974ca7a1f30276d3d8492ab266ab15af581642dfe8aa162e0c1c823 +soupsieve==2.10 ; python_full_version >= '3.11' and python_full_version < '3.11.5' \ + --hash=sha256:49e9380d7d2905463583bafe285e818c7366a9ed7b3aee221c1ac79c905d8bc0 \ + --hash=sha256:8596eb8967d744174820280fa62b4542a2e955bfaccca73ed8a13c6eb8e9b502 + # via beautifulsoup4 +soupsieve==4.1.1 ; python_full_version >= '3.11.5' \ + --hash=sha256:8ff3422dab0b720fb667ee79864d80531a0e57994a13eb701697719ffcb751f6 \ + --hash=sha256:b296bd2d2f65b1a78149f3d7bf6736a147d2c9e2dfbde0e4404639d748a02e03 # via beautifulsoup4 stack-data==0.6.3 \ --hash=sha256:836a778de4fec4dcd1dcd89ed8abff8a221f58308462e1c4aa2a3cf30148f0b9 \ diff --git a/python/uv.lock b/python/uv.lock index 71f021bfa..2cc60d51a 100644 --- a/python/uv.lock +++ b/python/uv.lock @@ -1,10 +1,11 @@ version = 1 -revision = 3 +revision = 2 requires-python = ">=3.10" resolution-markers = [ "python_full_version >= '3.15'", "python_full_version == '3.14.*'", - "python_full_version >= '3.11' and python_full_version < '3.14'", + "python_full_version >= '3.11.5' and python_full_version < '3.14'", + "python_full_version >= '3.11' and python_full_version < '3.11.5'", "python_full_version < '3.11'", ] @@ -186,7 +187,8 @@ name = "beautifulsoup4" version = "4.15.0" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "soupsieve", marker = "python_full_version >= '3.11'" }, + { name = "soupsieve", version = "2.10", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11' and python_full_version < '3.11.5'" }, + { name = "soupsieve", version = "4.1.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11.5'" }, { name = "typing-extensions", marker = "python_full_version >= '3.11'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/43/65/318323f98dbee45d42dff61d8f047181bc6f2268a9068cfad035a46be5af/beautifulsoup4-4.15.0.tar.gz", hash = "sha256:288e3ca7d54b06f2ac191970bc275c1939cb46d450b255bf6718b04aa37ab4f7", size = 632571, upload-time = "2026-06-07T16:44:20.453Z" } @@ -688,7 +690,8 @@ source = { registry = "https://pypi.org/simple" } resolution-markers = [ "python_full_version >= '3.15'", "python_full_version == '3.14.*'", - "python_full_version >= '3.11' and python_full_version < '3.14'", + "python_full_version >= '3.11.5' and python_full_version < '3.14'", + "python_full_version >= '3.11' and python_full_version < '3.11.5'", ] sdist = { url = "https://files.pythonhosted.org/packages/86/5f/f5c3d1b4e9c8c541406ca0654efa1bfaa05414f8e7d1c14bc6e3fd0752f8/cwcwidth-0.1.12.tar.gz", hash = "sha256:bfc16531d1246dd2558eb9b3a63aa37a9978672b956860dc5426da2343ebf366", size = 72009, upload-time = "2025-11-01T17:48:53.683Z" } wheels = [ @@ -1172,7 +1175,8 @@ source = { registry = "https://pypi.org/simple" } resolution-markers = [ "python_full_version >= '3.15'", "python_full_version == '3.14.*'", - "python_full_version >= '3.11' and python_full_version < '3.14'", + "python_full_version >= '3.11.5' and python_full_version < '3.14'", + "python_full_version >= '3.11' and python_full_version < '3.11.5'", ] dependencies = [ { name = "colorama", marker = "python_full_version >= '3.11' and sys_platform == 'win32'" }, @@ -2592,7 +2596,8 @@ source = { registry = "https://pypi.org/simple" } resolution-markers = [ "python_full_version >= '3.15'", "python_full_version == '3.14.*'", - "python_full_version >= '3.11' and python_full_version < '3.14'", + "python_full_version >= '3.11.5' and python_full_version < '3.14'", + "python_full_version >= '3.11' and python_full_version < '3.11.5'", ] sdist = { url = "https://files.pythonhosted.org/packages/aa/2a/9618a122aeb2a169a28b03889a2995fe297588964333d4a7d67bdf46e147/rpds_py-2026.6.3.tar.gz", hash = "sha256:1cebd1337c242e4ec2293e541f712b2da849b29f48f0c293684b71c0632625d4", size = 64051, upload-time = "2026-06-30T07:17:53.009Z" } wheels = [ @@ -2758,11 +2763,28 @@ wheels = [ [[package]] name = "soupsieve" -version = "2.9.2" +version = "2.10" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/69/99/a6ca3beb3ccacb41fb3321d8a60e5566f9e6467601ef8eba6a17e1b89778/soupsieve-2.9.2.tar.gz", hash = "sha256:4a55d8cf158a9c2e587fa4922f1bbb91d68ac829e2d6f25403a85747c71daf74", size = 122445, upload-time = "2026-08-07T00:57:24.801Z" } +resolution-markers = [ + "python_full_version >= '3.11' and python_full_version < '3.11.5'", +] +sdist = { url = "https://files.pythonhosted.org/packages/71/c3/1b817965ac12dc002d7c9cd7dfffdd7d4fbf9b45763ef2ffe7b86ee94670/soupsieve-2.10.tar.gz", hash = "sha256:49e9380d7d2905463583bafe285e818c7366a9ed7b3aee221c1ac79c905d8bc0", size = 124337, upload-time = "2026-09-24T02:36:35.048Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/66/87/5ed59e1d0290564e2027ed066c52b059892c4637741337fc0967183c8d4d/soupsieve-2.10-py3-none-any.whl", hash = "sha256:8596eb8967d744174820280fa62b4542a2e955bfaccca73ed8a13c6eb8e9b502", size = 38019, upload-time = "2026-09-24T02:36:33.709Z" }, +] + +[[package]] +name = "soupsieve" +version = "4.1.1" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version >= '3.15'", + "python_full_version == '3.14.*'", + "python_full_version >= '3.11.5' and python_full_version < '3.14'", +] +sdist = { url = "https://files.pythonhosted.org/packages/1f/52/ee5646b65d98a252e807ccc37725363942372a4113072e0bce7ed22f8b84/soupsieve-4.1.1.tar.gz", hash = "sha256:b296bd2d2f65b1a78149f3d7bf6736a147d2c9e2dfbde0e4404639d748a02e03", size = 169784, upload-time = "2026-11-14T17:23:32.467Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/eb/dc/ad025c1ee131eba60c69f4dd5779b18fcf1e6b21a343e2162a84d5d133c7/soupsieve-2.9.2-py3-none-any.whl", hash = "sha256:8089a26fd974ca7a1f30276d3d8492ab266ab15af581642dfe8aa162e0c1c823", size = 37370, upload-time = "2026-08-07T00:57:23.524Z" }, + { url = "https://files.pythonhosted.org/packages/cd/65/7fae69a095696195334a934eab23aeb12e2715e6c3f08025d2f91942750e/soupsieve-4.1.1-py3-none-any.whl", hash = "sha256:8ff3422dab0b720fb667ee79864d80531a0e57994a13eb701697719ffcb751f6", size = 55089, upload-time = "2026-11-14T17:23:31.001Z" }, ] [[package]] diff --git a/rs/dotprompt/src/dotprompt.rs b/rs/dotprompt/src/dotprompt.rs index 77d52667b..c2625d3ef 100644 --- a/rs/dotprompt/src/dotprompt.rs +++ b/rs/dotprompt/src/dotprompt.rs @@ -351,7 +351,7 @@ impl Dotprompt { for (key, value) in context { // Use __ctx_{key} as workaround since Handlebars treats @ as private data prefix let internal_key = format!("__ctx_{key}"); - map.insert(internal_key.clone(), value.clone()); + map.insert(internal_key, value.clone()); // Replace all occurrences of @{key} with __ctx_{key} in template template_to_render = template_to_render