diff --git a/.github/workflows/librarian_generation_check.yaml b/.github/workflows/librarian_generation_check.yaml index 7e795b4109ac..a5d695fbacfc 100644 --- a/.github/workflows/librarian_generation_check.yaml +++ b/.github/workflows/librarian_generation_check.yaml @@ -46,14 +46,9 @@ jobs: with: fetch-depth: 0 persist-credentials: false - - uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5 - with: - go-version: 'stable' - - name: Install Librarian - run: | - V=$(go run github.com/googleapis/librarian/cmd/librarian@latest config get version) - echo "Installing librarian version $V" - go install github.com/googleapis/librarian/cmd/librarian@$V + # Version of librarian is pulled from librarian.yaml, + # action is pinned to commit SHA to satisfy blanket security policy. + - uses: googleapis/librarian@c54791693e09a76a7403f3dc81c7c97782908b3d # v0.53.0 - uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4.8.0 with: java-version: "17" @@ -101,7 +96,7 @@ jobs: fi - name: Create issue if previous step fails if: ${{ failure() && github.event_name == 'push' && github.ref == 'refs/heads/main' }} - uses: googleapis/librarian/.github/actions/create-issue-on-failure@35997441eafc2b02716804f9baba1e3f04f8a44f # v0.31.1 + uses: googleapis/librarian/.github/actions/create-issue-on-failure@c54791693e09a76a7403f3dc81c7c97782908b3d # v0.53.0 with: title: "Librarian generate diff check failed on main branch" body: | diff --git a/.github/workflows/showcase-version-check.yaml b/.github/workflows/showcase-version-check.yaml index c8b7745faffe..0d784a533f93 100644 --- a/.github/workflows/showcase-version-check.yaml +++ b/.github/workflows/showcase-version-check.yaml @@ -53,16 +53,14 @@ jobs: run: | version=$(awk -F'[<>]' '/gapic-showcase.version/{print $3; exit}' java-showcase/gapic-showcase/pom.xml) echo "version=$version" >> "$GITHUB_OUTPUT" - - name: Set up Go - uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5 - with: - go-version: '1.24' + # Version of librarian is pulled from librarian.yaml, + # action is pinned to commit SHA to satisfy blanket security policy. + - uses: googleapis/librarian@c54791693e09a76a7403f3dc81c7c97782908b3d # v0.53.0 - name: Extract showcase commit from librarian.yaml id: extract_commit shell: bash run: | - version=$(go run github.com/googleapis/librarian/cmd/librarian@latest config get version) - commit=$(go run "github.com/googleapis/librarian/cmd/librarian@${version}" config get sources.showcase.commit) + commit=$(librarian config get sources.showcase.commit) echo "commit=$commit" >> "$GITHUB_OUTPUT" - name: Verify showcase version and commit match shell: bash diff --git a/.github/workflows/showcase.yaml b/.github/workflows/showcase.yaml index 1940f529f041..5624d2006a97 100644 --- a/.github/workflows/showcase.yaml +++ b/.github/workflows/showcase.yaml @@ -138,15 +138,11 @@ jobs: env: BUILD_SUBDIR: sdk-platform-java JOB_TYPE: install - - uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5 - with: - go-version: 'stable' - - name: Install Librarian and tools - run: | - V=$(go run github.com/googleapis/librarian/cmd/librarian@latest config get version) - echo "Installing librarian version $V" - go install github.com/googleapis/librarian/cmd/librarian@$V - librarian install + # Version of librarian is pulled from librarian.yaml, + # action is pinned to commit SHA to satisfy blanket security policy. + - uses: googleapis/librarian@c54791693e09a76a7403f3dc81c7c97782908b3d # v0.53.0 + - name: Install Librarian tools + run: librarian install - name: Setup Java 17 for Golden Tests uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4.8.0 with: diff --git a/.github/workflows/update_librarian_googleapis.yaml b/.github/workflows/update_librarian_googleapis.yaml index b5089e99e60e..69172ecd5272 100644 --- a/.github/workflows/update_librarian_googleapis.yaml +++ b/.github/workflows/update_librarian_googleapis.yaml @@ -26,15 +26,11 @@ on: jobs: update-librarian-googleapis: runs-on: ubuntu-24.04 - defaults: - run: - working-directory: google-cloud-java steps: - name: Checkout google-cloud-java uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: repository: googleapis/google-cloud-java - path: google-cloud-java fetch-depth: 0 persist-credentials: false - name: Close Existing PR and Branch @@ -67,29 +63,19 @@ jobs: } fi fi - - name: Set up Go - uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5 - with: - go-version: '>=1.20.2' - - name: Get librarian version - id: librarian - run: | - version=$(go run github.com/googleapis/librarian/cmd/librarian@latest config get version) - echo "version=${version}" >> $GITHUB_OUTPUT + # Version of librarian is pulled from librarian.yaml, + # action is pinned to commit SHA to satisfy blanket security policy. + - uses: googleapis/librarian@c54791693e09a76a7403f3dc81c7c97782908b3d # v0.53.0 - name: Run librarian update & tidy run: | - go run "github.com/googleapis/librarian/cmd/librarian@${STEPS_LIBRARIAN_OUTPUTS_VERSION}" update sources.googleapis - go run "github.com/googleapis/librarian/cmd/librarian@${STEPS_LIBRARIAN_OUTPUTS_VERSION}" tidy - env: - STEPS_LIBRARIAN_OUTPUTS_VERSION: ${{ steps.librarian.outputs.version }} + librarian update sources.googleapis + librarian tidy - name: Get latest commit id: commit run: | - new_commit=$(go run "github.com/googleapis/librarian/cmd/librarian@${STEPS_LIBRARIAN_OUTPUTS_VERSION}" config get sources.googleapis.commit) + new_commit=$(librarian config get sources.googleapis.commit) echo "new_commit=${new_commit}" >> $GITHUB_OUTPUT echo "short_commit=${new_commit:0:7}" >> $GITHUB_OUTPUT - env: - STEPS_LIBRARIAN_OUTPUTS_VERSION: ${{ steps.librarian.outputs.version }} - name: Detect Changes To Librarian.yaml id: detect_librarian @@ -119,16 +105,11 @@ jobs: - name: Run librarian install if: steps.detect_librarian.outputs.has_changes == 'true' run: | - go run "github.com/googleapis/librarian/cmd/librarian@${STEPS_LIBRARIAN_OUTPUTS_VERSION}" install + librarian install echo "$HOME/.cache/librarian/bin/java_tools/bin" >> $GITHUB_PATH - env: - STEPS_LIBRARIAN_OUTPUTS_VERSION: ${{ steps.librarian.outputs.version }} - name: Generate Libraries if: steps.detect_librarian.outputs.has_changes == 'true' - run: | - go run "github.com/googleapis/librarian/cmd/librarian@${STEPS_LIBRARIAN_OUTPUTS_VERSION}" generate --all - env: - STEPS_LIBRARIAN_OUTPUTS_VERSION: ${{ steps.librarian.outputs.version }} + run: librarian generate --all - name: Commit and Create PR if: steps.detect_librarian.outputs.has_changes == 'true' env: