src/ci/publish_toolstate.sh SHELL 42 lines View on github.com → Search inside
1#!/bin/bash23set -euo pipefail4IFS=$'\n\t'56source "$(cd "$(dirname "$0")" && pwd)/shared.sh"78# The following lines are also found in src/bootstrap/toolstate.rs,9# so if updating here, please also update that file.1011export MESSAGE_FILE=$(mktemp -t msg.XXXXXX)1213git config --global user.email '7378925+rust-toolstate-update@users.noreply.github.com'14git config --global user.name 'Rust Toolstate Update'15git config --global credential.helper store16printf 'https://%s:x-oauth-basic@github.com\n' "$TOOLSTATE_REPO_ACCESS_TOKEN" \17    > "$HOME/.git-credentials"18git clone --depth=1 $TOOLSTATE_REPO1920GIT_COMMIT="$(git rev-parse HEAD)"21GIT_COMMIT_MSG="$(git log --format=%s -n1 HEAD)"2223cd rust-toolstate24FAILURE=125for RETRY_COUNT in 1 2 3 4 5; do26    # The purpose of this is to publish the new "current" toolstate in the toolstate repo.27    # This happens at the end of auto builds.28    # (Publishing the per-commit test results happens in src/bootstrap/toolstate.rs).29    "$(ciCheckoutPath)/src/tools/publish_toolstate.py" "$GIT_COMMIT" \30        "$GIT_COMMIT_MSG" \31        "$MESSAGE_FILE" \32        "$TOOLSTATE_REPO_ACCESS_TOKEN"33    # `git commit` failing means nothing to commit.34    FAILURE=035    git commit -a -F "$MESSAGE_FILE" || break36    # On failure randomly sleep for 0 to 3 seconds as a crude way to introduce jittering.37    git push origin master && break || sleep $(LC_ALL=C tr -cd 0-3 < /dev/urandom | head -c 1)38    FAILURE=139    git fetch origin master40    git reset --hard origin/master41done

Security findings 1

Detected a password embedded in a service connection URI, which may expose direct access to the referenced service.
warning security generic-credential-uri medium confidence

Get this view in your editor

Same data, no extra tab — call code_get_file + code_get_findings over MCP from Claude/Cursor/Copilot.

Generated by searchcode.com · powered by code_get_file + code_get_findings