Abacn commented on code in PR #41438:
URL: https://github.com/apache/beam/pull/41438#discussion_r4621288468


##########
.github/actions/setup-environment-action/action.yml:
##########
@@ -106,3 +114,43 @@ runs:
         go-version: ${{ inputs.go-version == 'default' && '1.26' || 
inputs.go-version }} # never set patch, to get latest patch releases.
         cache: ${{ inputs.disable-cache != 'true' }}
         cache-dependency-path: sdks/go.sum
+    # Both arduino/setup-protoc and Swatinem/rust-cache are on the ASF 
allowlist:
+    # 
https://github.com/apache/infrastructure-actions/blob/main/approved_patterns.yml
+    - name: Install Rust
+      if: ${{ inputs.rust-version != '' }}
+      shell: bash
+      env:
+        RUST_VERSION_INPUT: ${{ inputs.rust-version }}
+      run: | # zizmor: ignore[github-env] safe: adds rustup cargo bin 
directory to PATH
+        set -euo pipefail
+        toolchain="${RUST_VERSION_INPUT}"
+        if [[ "${toolchain}" == "default" ]]; then
+          toolchain="1.98.1"
+        fi
+        if [[ ! "${toolchain}" =~ ^[A-Za-z0-9._-]+$ ]]; then
+          echo "Invalid rust-version: ${toolchain}" >&2
+          exit 1
+        fi
+        cargo_bin="${CARGO_HOME:-${HOME}/.cargo}/bin"
+        export PATH="${cargo_bin}:${PATH}"
+        if command -v rustup > /dev/null 2>&1; then
+          rustup toolchain install "${toolchain}" --profile minimal 
--component rustfmt,clippy
+          rustup default "${toolchain}"
+        else
+          curl --proto '=https' --tlsv1.2 -fsSL --retry 5 https://sh.rustup.rs 
| sh -s -- -y --default-toolchain "${toolchain}" --profile minimal --component 
rustfmt,clippy --no-modify-path
+        fi
+        echo "${cargo_bin}" >> "${GITHUB_PATH}"
+        rustc --version
+        cargo --version
+    - name: Install protoc

Review Comment:
   nit: Install protoc (Rust) for clarity



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to