Skip to content

armgit / ax

Public Imported from GitHub
0

Agent Executor (AX) is Google's open agentic orchestration runtime

Go

chore: pin workflow actions and add read permissions

JBDd8ed0fe38bce
diff --git a/.github/workflows/check-binaries.yml b/.github/workflows/check-binaries.yml
index c06b7fa..0f767f1 100644
--- a/.github/workflows/check-binaries.yml
+++ b/.github/workflows/check-binaries.yml
@@ -18,19 +18,24 @@ on:
pull_request:
branches: [ "main" ]
+permissions:
+ contents: read
+
jobs:
check-no-binaries:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
- uses: actions/checkout@v4
+ uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Check for binary files in PR
+ env:
+ BASE_REF: ${{ github.base_ref }}
run: |
- git fetch origin ${{ github.base_ref }}
- BINARIES=$(git diff --numstat --diff-filter=ACM origin/${{ github.base_ref }}...HEAD | awk '$1 == "-" || $2 == "-" {print $3}')
+ git fetch origin "$BASE_REF"
+ BINARIES=$(git diff --numstat --diff-filter=ACM "origin/$BASE_REF...HEAD" | awk '$1 == "-" || $2 == "-" {print $3}')
if [ -n "$BINARIES" ]; then
echo "::error::Binary files are not allowed to be committed in PRs. Found:"
diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml
index e68bd2d..2bc48a6 100644
--- a/.github/workflows/go.yml
+++ b/.github/workflows/go.yml
@@ -20,14 +20,17 @@ on:
pull_request:
branches: [ "main" ]
+permissions:
+ contents: read
+
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Go
- uses: actions/setup-go@v5
+ uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version-file: go.mod