Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

ci: pin actions and restrict token permissions in Java and Rust SDK test workflows (#4916)

Gergő Móricz5951e265b562
diff --git a/.github/workflows/test-java-sdk.yml b/.github/workflows/test-java-sdk.yml
index 0de878392..c8a2fbf48 100644
--- a/.github/workflows/test-java-sdk.yml
+++ b/.github/workflows/test-java-sdk.yml
@@ -14,6 +14,9 @@ on:
- apps/java-sdk/**
workflow_dispatch:
+permissions:
+ contents: read
+
jobs:
build-and-test:
name: Build and Test
@@ -22,17 +25,22 @@ jobs:
github.event_name == 'workflow_dispatch' ||
github.event_name == 'pull_request' ||
(github.event_name == 'push' && github.ref == 'refs/heads/main')
+ permissions:
+ contents: read
+ checks: write
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+ with:
+ persist-credentials: false
- name: Set up JDK 11
- uses: actions/setup-java@v4
+ uses: actions/setup-java@cf277c60eb25467037889841efdb72551f06f6c3 # v4.9.1
with:
distribution: temurin
java-version: "11"
- name: Cache Gradle packages
- uses: actions/cache@v4
+ uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: |
~/.gradle/caches
diff --git a/.github/workflows/test-rust-sdk.yml b/.github/workflows/test-rust-sdk.yml
index c1a319416..8f89161a4 100644
--- a/.github/workflows/test-rust-sdk.yml
+++ b/.github/workflows/test-rust-sdk.yml
@@ -6,13 +6,19 @@ on:
- main
paths:
- apps/rust-sdk/**
+ - .github/workflows/test-rust-sdk.yml
+
+permissions:
+ contents: read
jobs:
test:
name: Build and Test
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+ with:
+ persist-credentials: false
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable
@@ -20,7 +26,7 @@ jobs:
components: clippy
- name: Cache cargo registry
- uses: actions/cache@v4
+ uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: |
~/.cargo/registry