diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5b97e4f6520..4e98498895b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,7 +63,7 @@ jobs: android_matrix: ${{ steps.manifest.outputs.android_matrix }} steps: - name: Checkout - uses: actions/checkout@v6 + uses: useblacksmith/checkout@v1 with: fetch-depth: 1 fetch-tags: false @@ -329,7 +329,7 @@ jobs: PRE_COMMIT_HOME: .cache/pre-commit-security-fast steps: - name: Checkout - uses: actions/checkout@v6 + uses: useblacksmith/checkout@v1 with: fetch-depth: 1 fetch-tags: false @@ -407,7 +407,7 @@ jobs: timeout-minutes: 10 steps: - name: Checkout - uses: actions/checkout@v6 + uses: useblacksmith/checkout@v1 with: fetch-depth: 1 fetch-tags: false @@ -464,52 +464,12 @@ jobs: timeout-minutes: 20 steps: - name: Checkout - shell: bash - env: - CHECKOUT_REPO: ${{ github.repository }} - CHECKOUT_SHA: ${{ github.sha }} - CHECKOUT_TOKEN: ${{ github.token }} - run: | - set -euo pipefail - - workdir="$GITHUB_WORKSPACE" - auth_header="$(printf 'x-access-token:%s' "$CHECKOUT_TOKEN" | base64 | tr -d '\n')" - - reset_checkout_dir() { - mkdir -p "$workdir" - find "$workdir" -mindepth 1 -maxdepth 1 -exec rm -rf {} + - } - - checkout_attempt() { - local attempt="$1" - - reset_checkout_dir - git init "$workdir" >/dev/null - git config --global --add safe.directory "$workdir" - git -C "$workdir" remote add origin "https://github.com/${CHECKOUT_REPO}" - git -C "$workdir" config gc.auto 0 - - timeout --signal=TERM 120s git -C "$workdir" \ - -c protocol.version=2 \ - -c "http.https://github.com/.extraheader=AUTHORIZATION: basic ${auth_header}" \ - fetch --no-tags --prune --no-recurse-submodules --depth=1 origin \ - "+${CHECKOUT_SHA}:refs/remotes/origin/ci-target" || return 1 - - git -C "$workdir" checkout --force --detach "$CHECKOUT_SHA" || return 1 - test -f "$workdir/.github/actions/setup-node-env/action.yml" || return 1 - echo "checkout attempt ${attempt}/2 succeeded" - } - - for attempt in 1 2; do - if checkout_attempt "$attempt"; then - exit 0 - fi - echo "checkout attempt ${attempt}/2 failed" - sleep $((attempt * 5)) - done - - echo "checkout failed after 2 attempts" >&2 - exit 1 + uses: useblacksmith/checkout@v1 + with: + fetch-depth: 1 + fetch-tags: false + persist-credentials: false + submodules: false - name: Ensure secrets base commit (PR fast path) if: github.event_name == 'pull_request' @@ -564,52 +524,12 @@ jobs: matrix: ${{ fromJson(needs.preflight.outputs.checks_fast_core_matrix) }} steps: - name: Checkout - shell: bash - env: - CHECKOUT_REPO: ${{ github.repository }} - CHECKOUT_SHA: ${{ github.sha }} - CHECKOUT_TOKEN: ${{ github.token }} - run: | - set -euo pipefail - - workdir="$GITHUB_WORKSPACE" - auth_header="$(printf 'x-access-token:%s' "$CHECKOUT_TOKEN" | base64 | tr -d '\n')" - - reset_checkout_dir() { - mkdir -p "$workdir" - find "$workdir" -mindepth 1 -maxdepth 1 -exec rm -rf {} + - } - - checkout_attempt() { - local attempt="$1" - - reset_checkout_dir - git init "$workdir" >/dev/null - git config --global --add safe.directory "$workdir" - git -C "$workdir" remote add origin "https://github.com/${CHECKOUT_REPO}" - git -C "$workdir" config gc.auto 0 - - timeout --signal=TERM 120s git -C "$workdir" \ - -c protocol.version=2 \ - -c "http.https://github.com/.extraheader=AUTHORIZATION: basic ${auth_header}" \ - fetch --no-tags --prune --no-recurse-submodules --depth=1 origin \ - "+${CHECKOUT_SHA}:refs/remotes/origin/ci-target" || return 1 - - git -C "$workdir" checkout --force --detach "$CHECKOUT_SHA" || return 1 - test -f "$workdir/.github/actions/setup-node-env/action.yml" || return 1 - echo "checkout attempt ${attempt}/2 succeeded" - } - - for attempt in 1 2; do - if checkout_attempt "$attempt"; then - exit 0 - fi - echo "checkout attempt ${attempt}/2 failed" - sleep $((attempt * 5)) - done - - echo "checkout failed after 2 attempts" >&2 - exit 1 + uses: useblacksmith/checkout@v1 + with: + fetch-depth: 1 + fetch-tags: false + persist-credentials: false + submodules: false - name: Setup Node environment uses: ./.github/actions/setup-node-env @@ -652,52 +572,12 @@ jobs: matrix: ${{ fromJson(needs.preflight.outputs.channel_contracts_matrix) }} steps: - name: Checkout - shell: bash - env: - CHECKOUT_REPO: ${{ github.repository }} - CHECKOUT_SHA: ${{ github.sha }} - CHECKOUT_TOKEN: ${{ github.token }} - run: | - set -euo pipefail - - workdir="$GITHUB_WORKSPACE" - auth_header="$(printf 'x-access-token:%s' "$CHECKOUT_TOKEN" | base64 | tr -d '\n')" - - reset_checkout_dir() { - mkdir -p "$workdir" - find "$workdir" -mindepth 1 -maxdepth 1 -exec rm -rf {} + - } - - checkout_attempt() { - local attempt="$1" - - reset_checkout_dir - git init "$workdir" >/dev/null - git config --global --add safe.directory "$workdir" - git -C "$workdir" remote add origin "https://github.com/${CHECKOUT_REPO}" - git -C "$workdir" config gc.auto 0 - - timeout --signal=TERM 120s git -C "$workdir" \ - -c protocol.version=2 \ - -c "http.https://github.com/.extraheader=AUTHORIZATION: basic ${auth_header}" \ - fetch --no-tags --prune --no-recurse-submodules --depth=1 origin \ - "+${CHECKOUT_SHA}:refs/remotes/origin/ci-target" || return 1 - - git -C "$workdir" checkout --force --detach "$CHECKOUT_SHA" || return 1 - test -f "$workdir/.github/actions/setup-node-env/action.yml" || return 1 - echo "checkout attempt ${attempt}/2 succeeded" - } - - for attempt in 1 2; do - if checkout_attempt "$attempt"; then - exit 0 - fi - echo "checkout attempt ${attempt}/2 failed" - sleep $((attempt * 5)) - done - - echo "checkout failed after 2 attempts" >&2 - exit 1 + uses: useblacksmith/checkout@v1 + with: + fetch-depth: 1 + fetch-tags: false + persist-credentials: false + submodules: false - name: Setup Node environment uses: ./.github/actions/setup-node-env @@ -755,52 +635,12 @@ jobs: timeout-minutes: 30 steps: - name: Checkout - shell: bash - env: - CHECKOUT_REPO: ${{ github.repository }} - CHECKOUT_SHA: ${{ github.sha }} - CHECKOUT_TOKEN: ${{ github.token }} - run: | - set -euo pipefail - - workdir="$GITHUB_WORKSPACE" - auth_header="$(printf 'x-access-token:%s' "$CHECKOUT_TOKEN" | base64 | tr -d '\n')" - - reset_checkout_dir() { - mkdir -p "$workdir" - find "$workdir" -mindepth 1 -maxdepth 1 -exec rm -rf {} + - } - - checkout_attempt() { - local attempt="$1" - - reset_checkout_dir - git init "$workdir" >/dev/null - git config --global --add safe.directory "$workdir" - git -C "$workdir" remote add origin "https://github.com/${CHECKOUT_REPO}" - git -C "$workdir" config gc.auto 0 - - timeout --signal=TERM 120s git -C "$workdir" \ - -c protocol.version=2 \ - -c "http.https://github.com/.extraheader=AUTHORIZATION: basic ${auth_header}" \ - fetch --no-tags --prune --no-recurse-submodules --depth=1 origin \ - "+${CHECKOUT_SHA}:refs/remotes/origin/ci-target" || return 1 - - git -C "$workdir" checkout --force --detach "$CHECKOUT_SHA" || return 1 - test -f "$workdir/.github/actions/setup-node-env/action.yml" || return 1 - echo "checkout attempt ${attempt}/2 succeeded" - } - - for attempt in 1 2; do - if checkout_attempt "$attempt"; then - exit 0 - fi - echo "checkout attempt ${attempt}/2 failed" - sleep $((attempt * 5)) - done - - echo "checkout failed after 2 attempts" >&2 - exit 1 + uses: useblacksmith/checkout@v1 + with: + fetch-depth: 1 + fetch-tags: false + persist-credentials: false + submodules: false - name: Setup Node environment uses: ./.github/actions/setup-node-env @@ -823,52 +663,12 @@ jobs: matrix: ${{ fromJson(needs.preflight.outputs.checks_node_extensions_matrix) }} steps: - name: Checkout - shell: bash - env: - CHECKOUT_REPO: ${{ github.repository }} - CHECKOUT_SHA: ${{ github.sha }} - CHECKOUT_TOKEN: ${{ github.token }} - run: | - set -euo pipefail - - workdir="$GITHUB_WORKSPACE" - auth_header="$(printf 'x-access-token:%s' "$CHECKOUT_TOKEN" | base64 | tr -d '\n')" - - reset_checkout_dir() { - mkdir -p "$workdir" - find "$workdir" -mindepth 1 -maxdepth 1 -exec rm -rf {} + - } - - checkout_attempt() { - local attempt="$1" - - reset_checkout_dir - git init "$workdir" >/dev/null - git config --global --add safe.directory "$workdir" - git -C "$workdir" remote add origin "https://github.com/${CHECKOUT_REPO}" - git -C "$workdir" config gc.auto 0 - - timeout --signal=TERM 120s git -C "$workdir" \ - -c protocol.version=2 \ - -c "http.https://github.com/.extraheader=AUTHORIZATION: basic ${auth_header}" \ - fetch --no-tags --prune --no-recurse-submodules --depth=1 origin \ - "+${CHECKOUT_SHA}:refs/remotes/origin/ci-target" || return 1 - - git -C "$workdir" checkout --force --detach "$CHECKOUT_SHA" || return 1 - test -f "$workdir/.github/actions/setup-node-env/action.yml" || return 1 - echo "checkout attempt ${attempt}/2 succeeded" - } - - for attempt in 1 2; do - if checkout_attempt "$attempt"; then - exit 0 - fi - echo "checkout attempt ${attempt}/2 failed" - sleep $((attempt * 5)) - done - - echo "checkout failed after 2 attempts" >&2 - exit 1 + uses: useblacksmith/checkout@v1 + with: + fetch-depth: 1 + fetch-tags: false + persist-credentials: false + submodules: false - name: Setup Node environment uses: ./.github/actions/setup-node-env @@ -916,52 +716,12 @@ jobs: - name: Checkout if: github.event_name != 'pull_request' || matrix.task != 'compat-node22' - shell: bash - env: - CHECKOUT_REPO: ${{ github.repository }} - CHECKOUT_SHA: ${{ github.sha }} - CHECKOUT_TOKEN: ${{ github.token }} - run: | - set -euo pipefail - - workdir="$GITHUB_WORKSPACE" - auth_header="$(printf 'x-access-token:%s' "$CHECKOUT_TOKEN" | base64 | tr -d '\n')" - - reset_checkout_dir() { - mkdir -p "$workdir" - find "$workdir" -mindepth 1 -maxdepth 1 -exec rm -rf {} + - } - - checkout_attempt() { - local attempt="$1" - - reset_checkout_dir - git init "$workdir" >/dev/null - git config --global --add safe.directory "$workdir" - git -C "$workdir" remote add origin "https://github.com/${CHECKOUT_REPO}" - git -C "$workdir" config gc.auto 0 - - timeout --signal=TERM 120s git -C "$workdir" \ - -c protocol.version=2 \ - -c "http.https://github.com/.extraheader=AUTHORIZATION: basic ${auth_header}" \ - fetch --no-tags --prune --no-recurse-submodules --depth=1 origin \ - "+${CHECKOUT_SHA}:refs/remotes/origin/ci-target" || return 1 - - git -C "$workdir" checkout --force --detach "$CHECKOUT_SHA" || return 1 - test -f "$workdir/.github/actions/setup-node-env/action.yml" || return 1 - echo "checkout attempt ${attempt}/2 succeeded" - } - - for attempt in 1 2; do - if checkout_attempt "$attempt"; then - exit 0 - fi - echo "checkout attempt ${attempt}/2 failed" - sleep $((attempt * 5)) - done - - echo "checkout failed after 2 attempts" >&2 - exit 1 + uses: useblacksmith/checkout@v1 + with: + fetch-depth: 1 + fetch-tags: false + persist-credentials: false + submodules: false - name: Setup Node environment if: github.event_name != 'pull_request' || matrix.task != 'compat-node22' @@ -1040,52 +800,12 @@ jobs: matrix: ${{ fromJson(needs.preflight.outputs.checks_node_core_nondist_matrix) }} steps: - name: Checkout - shell: bash - env: - CHECKOUT_REPO: ${{ github.repository }} - CHECKOUT_SHA: ${{ github.sha }} - CHECKOUT_TOKEN: ${{ github.token }} - run: | - set -euo pipefail - - workdir="$GITHUB_WORKSPACE" - auth_header="$(printf 'x-access-token:%s' "$CHECKOUT_TOKEN" | base64 | tr -d '\n')" - - reset_checkout_dir() { - mkdir -p "$workdir" - find "$workdir" -mindepth 1 -maxdepth 1 -exec rm -rf {} + - } - - checkout_attempt() { - local attempt="$1" - - reset_checkout_dir - git init "$workdir" >/dev/null - git config --global --add safe.directory "$workdir" - git -C "$workdir" remote add origin "https://github.com/${CHECKOUT_REPO}" - git -C "$workdir" config gc.auto 0 - - timeout --signal=TERM 120s git -C "$workdir" \ - -c protocol.version=2 \ - -c "http.https://github.com/.extraheader=AUTHORIZATION: basic ${auth_header}" \ - fetch --no-tags --prune --no-recurse-submodules --depth=1 origin \ - "+${CHECKOUT_SHA}:refs/remotes/origin/ci-target" || return 1 - - git -C "$workdir" checkout --force --detach "$CHECKOUT_SHA" || return 1 - test -f "$workdir/.github/actions/setup-node-env/action.yml" || return 1 - echo "checkout attempt ${attempt}/2 succeeded" - } - - for attempt in 1 2; do - if checkout_attempt "$attempt"; then - exit 0 - fi - echo "checkout attempt ${attempt}/2 failed" - sleep $((attempt * 5)) - done - - echo "checkout failed after 2 attempts" >&2 - exit 1 + uses: useblacksmith/checkout@v1 + with: + fetch-depth: 1 + fetch-tags: false + persist-credentials: false + submodules: false - name: Setup Node environment uses: ./.github/actions/setup-node-env @@ -1164,52 +884,12 @@ jobs: matrix: ${{ fromJson(needs.preflight.outputs.checks_node_core_dist_matrix) }} steps: - name: Checkout - shell: bash - env: - CHECKOUT_REPO: ${{ github.repository }} - CHECKOUT_SHA: ${{ github.sha }} - CHECKOUT_TOKEN: ${{ github.token }} - run: | - set -euo pipefail - - workdir="$GITHUB_WORKSPACE" - auth_header="$(printf 'x-access-token:%s' "$CHECKOUT_TOKEN" | base64 | tr -d '\n')" - - reset_checkout_dir() { - mkdir -p "$workdir" - find "$workdir" -mindepth 1 -maxdepth 1 -exec rm -rf {} + - } - - checkout_attempt() { - local attempt="$1" - - reset_checkout_dir - git init "$workdir" >/dev/null - git config --global --add safe.directory "$workdir" - git -C "$workdir" remote add origin "https://github.com/${CHECKOUT_REPO}" - git -C "$workdir" config gc.auto 0 - - timeout --signal=TERM 120s git -C "$workdir" \ - -c protocol.version=2 \ - -c "http.https://github.com/.extraheader=AUTHORIZATION: basic ${auth_header}" \ - fetch --no-tags --prune --no-recurse-submodules --depth=1 origin \ - "+${CHECKOUT_SHA}:refs/remotes/origin/ci-target" || return 1 - - git -C "$workdir" checkout --force --detach "$CHECKOUT_SHA" || return 1 - test -f "$workdir/.github/actions/setup-node-env/action.yml" || return 1 - echo "checkout attempt ${attempt}/2 succeeded" - } - - for attempt in 1 2; do - if checkout_attempt "$attempt"; then - exit 0 - fi - echo "checkout attempt ${attempt}/2 failed" - sleep $((attempt * 5)) - done - - echo "checkout failed after 2 attempts" >&2 - exit 1 + uses: useblacksmith/checkout@v1 + with: + fetch-depth: 1 + fetch-tags: false + persist-credentials: false + submodules: false - name: Setup Node environment uses: ./.github/actions/setup-node-env @@ -1333,52 +1013,12 @@ jobs: matrix: ${{ fromJson(needs.preflight.outputs.extension_fast_matrix) }} steps: - name: Checkout - shell: bash - env: - CHECKOUT_REPO: ${{ github.repository }} - CHECKOUT_SHA: ${{ github.sha }} - CHECKOUT_TOKEN: ${{ github.token }} - run: | - set -euo pipefail - - workdir="$GITHUB_WORKSPACE" - auth_header="$(printf 'x-access-token:%s' "$CHECKOUT_TOKEN" | base64 | tr -d '\n')" - - reset_checkout_dir() { - mkdir -p "$workdir" - find "$workdir" -mindepth 1 -maxdepth 1 -exec rm -rf {} + - } - - checkout_attempt() { - local attempt="$1" - - reset_checkout_dir - git init "$workdir" >/dev/null - git config --global --add safe.directory "$workdir" - git -C "$workdir" remote add origin "https://github.com/${CHECKOUT_REPO}" - git -C "$workdir" config gc.auto 0 - - timeout --signal=TERM 120s git -C "$workdir" \ - -c protocol.version=2 \ - -c "http.https://github.com/.extraheader=AUTHORIZATION: basic ${auth_header}" \ - fetch --no-tags --prune --no-recurse-submodules --depth=1 origin \ - "+${CHECKOUT_SHA}:refs/remotes/origin/ci-target" || return 1 - - git -C "$workdir" checkout --force --detach "$CHECKOUT_SHA" || return 1 - test -f "$workdir/.github/actions/setup-node-env/action.yml" || return 1 - echo "checkout attempt ${attempt}/2 succeeded" - } - - for attempt in 1 2; do - if checkout_attempt "$attempt"; then - exit 0 - fi - echo "checkout attempt ${attempt}/2 failed" - sleep $((attempt * 5)) - done - - echo "checkout failed after 2 attempts" >&2 - exit 1 + uses: useblacksmith/checkout@v1 + with: + fetch-depth: 1 + fetch-tags: false + persist-credentials: false + submodules: false - name: Setup Node environment uses: ./.github/actions/setup-node-env @@ -1417,52 +1057,12 @@ jobs: task: strict-smoke steps: - name: Checkout - shell: bash - env: - CHECKOUT_REPO: ${{ github.repository }} - CHECKOUT_SHA: ${{ github.sha }} - CHECKOUT_TOKEN: ${{ github.token }} - run: | - set -euo pipefail - - workdir="$GITHUB_WORKSPACE" - auth_header="$(printf 'x-access-token:%s' "$CHECKOUT_TOKEN" | base64 | tr -d '\n')" - - reset_checkout_dir() { - mkdir -p "$workdir" - find "$workdir" -mindepth 1 -maxdepth 1 -exec rm -rf {} + - } - - checkout_attempt() { - local attempt="$1" - - reset_checkout_dir - git init "$workdir" >/dev/null - git config --global --add safe.directory "$workdir" - git -C "$workdir" remote add origin "https://github.com/${CHECKOUT_REPO}" - git -C "$workdir" config gc.auto 0 - - timeout --signal=TERM 120s git -C "$workdir" \ - -c protocol.version=2 \ - -c "http.https://github.com/.extraheader=AUTHORIZATION: basic ${auth_header}" \ - fetch --no-tags --prune --no-recurse-submodules --depth=1 origin \ - "+${CHECKOUT_SHA}:refs/remotes/origin/ci-target" || return 1 - - git -C "$workdir" checkout --force --detach "$CHECKOUT_SHA" || return 1 - test -f "$workdir/.github/actions/setup-node-env/action.yml" || return 1 - echo "checkout attempt ${attempt}/2 succeeded" - } - - for attempt in 1 2; do - if checkout_attempt "$attempt"; then - exit 0 - fi - echo "checkout attempt ${attempt}/2 failed" - sleep $((attempt * 5)) - done - - echo "checkout failed after 2 attempts" >&2 - exit 1 + uses: useblacksmith/checkout@v1 + with: + fetch-depth: 1 + fetch-tags: false + persist-credentials: false + submodules: false - name: Setup Node environment uses: ./.github/actions/setup-node-env @@ -1552,52 +1152,12 @@ jobs: group: runtime-topology-architecture steps: - name: Checkout - shell: bash - env: - CHECKOUT_REPO: ${{ github.repository }} - CHECKOUT_SHA: ${{ github.sha }} - CHECKOUT_TOKEN: ${{ github.token }} - run: | - set -euo pipefail - - workdir="$GITHUB_WORKSPACE" - auth_header="$(printf 'x-access-token:%s' "$CHECKOUT_TOKEN" | base64 | tr -d '\n')" - - reset_checkout_dir() { - mkdir -p "$workdir" - find "$workdir" -mindepth 1 -maxdepth 1 -exec rm -rf {} + - } - - checkout_attempt() { - local attempt="$1" - - reset_checkout_dir - git init "$workdir" >/dev/null - git config --global --add safe.directory "$workdir" - git -C "$workdir" remote add origin "https://github.com/${CHECKOUT_REPO}" - git -C "$workdir" config gc.auto 0 - - timeout --signal=TERM 120s git -C "$workdir" \ - -c protocol.version=2 \ - -c "http.https://github.com/.extraheader=AUTHORIZATION: basic ${auth_header}" \ - fetch --no-tags --prune --no-recurse-submodules --depth=1 origin \ - "+${CHECKOUT_SHA}:refs/remotes/origin/ci-target" || return 1 - - git -C "$workdir" checkout --force --detach "$CHECKOUT_SHA" || return 1 - test -f "$workdir/.github/actions/setup-node-env/action.yml" || return 1 - echo "checkout attempt ${attempt}/2 succeeded" - } - - for attempt in 1 2; do - if checkout_attempt "$attempt"; then - exit 0 - fi - echo "checkout attempt ${attempt}/2 failed" - sleep $((attempt * 5)) - done - - echo "checkout failed after 2 attempts" >&2 - exit 1 + uses: useblacksmith/checkout@v1 + with: + fetch-depth: 1 + fetch-tags: false + persist-credentials: false + submodules: false - name: Setup Node environment uses: ./.github/actions/setup-node-env @@ -1714,52 +1274,12 @@ jobs: timeout-minutes: 20 steps: - name: Checkout - shell: bash - env: - CHECKOUT_REPO: ${{ github.repository }} - CHECKOUT_SHA: ${{ github.sha }} - CHECKOUT_TOKEN: ${{ github.token }} - run: | - set -euo pipefail - - workdir="$GITHUB_WORKSPACE" - auth_header="$(printf 'x-access-token:%s' "$CHECKOUT_TOKEN" | base64 | tr -d '\n')" - - reset_checkout_dir() { - mkdir -p "$workdir" - find "$workdir" -mindepth 1 -maxdepth 1 -exec rm -rf {} + - } - - checkout_attempt() { - local attempt="$1" - - reset_checkout_dir - git init "$workdir" >/dev/null - git config --global --add safe.directory "$workdir" - git -C "$workdir" remote add origin "https://github.com/${CHECKOUT_REPO}" - git -C "$workdir" config gc.auto 0 - - timeout --signal=TERM 120s git -C "$workdir" \ - -c protocol.version=2 \ - -c "http.https://github.com/.extraheader=AUTHORIZATION: basic ${auth_header}" \ - fetch --no-tags --prune --no-recurse-submodules --depth=1 origin \ - "+${CHECKOUT_SHA}:refs/remotes/origin/ci-target" || return 1 - - git -C "$workdir" checkout --force --detach "$CHECKOUT_SHA" || return 1 - test -f "$workdir/.github/actions/setup-node-env/action.yml" || return 1 - echo "checkout attempt ${attempt}/2 succeeded" - } - - for attempt in 1 2; do - if checkout_attempt "$attempt"; then - exit 0 - fi - echo "checkout attempt ${attempt}/2 failed" - sleep $((attempt * 5)) - done - - echo "checkout failed after 2 attempts" >&2 - exit 1 + uses: useblacksmith/checkout@v1 + with: + fetch-depth: 1 + fetch-tags: false + persist-credentials: false + submodules: false - name: Setup Node environment uses: ./.github/actions/setup-node-env @@ -1810,52 +1330,12 @@ jobs: timeout-minutes: 20 steps: - name: Checkout - shell: bash - env: - CHECKOUT_REPO: ${{ github.repository }} - CHECKOUT_SHA: ${{ github.sha }} - CHECKOUT_TOKEN: ${{ github.token }} - run: | - set -euo pipefail - - workdir="$GITHUB_WORKSPACE" - auth_header="$(printf 'x-access-token:%s' "$CHECKOUT_TOKEN" | base64 | tr -d '\n')" - - reset_checkout_dir() { - mkdir -p "$workdir" - find "$workdir" -mindepth 1 -maxdepth 1 -exec rm -rf {} + - } - - checkout_attempt() { - local attempt="$1" - - reset_checkout_dir - git init "$workdir" >/dev/null - git config --global --add safe.directory "$workdir" - git -C "$workdir" remote add origin "https://github.com/${CHECKOUT_REPO}" - git -C "$workdir" config gc.auto 0 - - timeout --signal=TERM 120s git -C "$workdir" \ - -c protocol.version=2 \ - -c "http.https://github.com/.extraheader=AUTHORIZATION: basic ${auth_header}" \ - fetch --no-tags --prune --no-recurse-submodules --depth=1 origin \ - "+${CHECKOUT_SHA}:refs/remotes/origin/ci-target" || return 1 - - git -C "$workdir" checkout --force --detach "$CHECKOUT_SHA" || return 1 - test -f "$workdir/.github/actions/setup-node-env/action.yml" || return 1 - echo "checkout attempt ${attempt}/2 succeeded" - } - - for attempt in 1 2; do - if checkout_attempt "$attempt"; then - exit 0 - fi - echo "checkout attempt ${attempt}/2 failed" - sleep $((attempt * 5)) - done - - echo "checkout failed after 2 attempts" >&2 - exit 1 + uses: useblacksmith/checkout@v1 + with: + fetch-depth: 1 + fetch-tags: false + persist-credentials: false + submodules: false - name: Setup Node environment uses: ./.github/actions/setup-node-env @@ -1874,7 +1354,7 @@ jobs: timeout-minutes: 20 steps: - name: Checkout - uses: actions/checkout@v6 + uses: useblacksmith/checkout@v1 with: persist-credentials: false submodules: false @@ -2201,7 +1681,7 @@ jobs: matrix: ${{ fromJson(needs.preflight.outputs.android_matrix) }} steps: - name: Checkout - uses: actions/checkout@v6 + uses: useblacksmith/checkout@v1 with: persist-credentials: false submodules: false diff --git a/.github/workflows/install-smoke.yml b/.github/workflows/install-smoke.yml index a995000dcf9..9f895bd08e3 100644 --- a/.github/workflows/install-smoke.yml +++ b/.github/workflows/install-smoke.yml @@ -26,7 +26,7 @@ jobs: run_install_smoke: ${{ steps.manifest.outputs.run_install_smoke }} steps: - name: Checkout - uses: actions/checkout@v6 + uses: useblacksmith/checkout@v1 with: fetch-depth: 1 fetch-tags: false @@ -91,7 +91,7 @@ jobs: DOCKER_BUILD_RECORD_UPLOAD: "false" steps: - name: Checkout CLI - uses: actions/checkout@v6 + uses: useblacksmith/checkout@v1 - name: Set up Blacksmith Docker Builder uses: useblacksmith/setup-docker-builder@ac083cc84672d01c60d5e8561d0a939b697de542 # v1 diff --git a/.github/workflows/openclaw-live-and-e2e-checks-reusable.yml b/.github/workflows/openclaw-live-and-e2e-checks-reusable.yml index dc79f868d5f..152227a7b0d 100644 --- a/.github/workflows/openclaw-live-and-e2e-checks-reusable.yml +++ b/.github/workflows/openclaw-live-and-e2e-checks-reusable.yml @@ -159,7 +159,7 @@ jobs: trusted_reason: ${{ steps.validate.outputs.trusted_reason }} steps: - name: Checkout selected ref - uses: actions/checkout@v6 + uses: useblacksmith/checkout@v1 with: ref: ${{ inputs.ref }} fetch-depth: 0 @@ -219,7 +219,7 @@ jobs: OPENCLAW_LIVE_TEST: "1" steps: - name: Checkout selected ref - uses: actions/checkout@v6 + uses: useblacksmith/checkout@v1 with: ref: ${{ needs.validate_selected_ref.outputs.selected_sha }} fetch-depth: 0 @@ -255,7 +255,7 @@ jobs: OPENCLAW_VITEST_MAX_WORKERS: "2" steps: - name: Checkout selected ref - uses: actions/checkout@v6 + uses: useblacksmith/checkout@v1 with: ref: ${{ needs.validate_selected_ref.outputs.selected_sha }} fetch-depth: 0 @@ -300,7 +300,7 @@ jobs: OPENCLAW_VITEST_MAX_WORKERS: "1" steps: - name: Checkout selected ref - uses: actions/checkout@v6 + uses: useblacksmith/checkout@v1 with: ref: ${{ needs.validate_selected_ref.outputs.selected_sha }} fetch-depth: 0 @@ -451,7 +451,7 @@ jobs: OPENCLAW_GEMINI_SETTINGS_JSON: ${{ secrets.OPENCLAW_GEMINI_SETTINGS_JSON }} steps: - name: Checkout selected ref - uses: actions/checkout@v6 + uses: useblacksmith/checkout@v1 with: ref: ${{ needs.validate_selected_ref.outputs.selected_sha }} fetch-depth: 0 @@ -593,7 +593,7 @@ jobs: OPENCLAW_VITEST_MAX_WORKERS: "2" steps: - name: Checkout selected ref - uses: actions/checkout@v6 + uses: useblacksmith/checkout@v1 with: ref: ${{ needs.validate_selected_ref.outputs.selected_sha }} fetch-depth: 0 diff --git a/.github/workflows/openclaw-release-checks.yml b/.github/workflows/openclaw-release-checks.yml index 1b86cda366d..85abe8af5bf 100644 --- a/.github/workflows/openclaw-release-checks.yml +++ b/.github/workflows/openclaw-release-checks.yml @@ -66,7 +66,7 @@ jobs: fi - name: Checkout selected ref - uses: actions/checkout@v6 + uses: useblacksmith/checkout@v1 with: ref: ${{ inputs.ref }} fetch-depth: 0 diff --git a/.github/workflows/parity-gate.yml b/.github/workflows/parity-gate.yml index 1c9082cfaf4..25e94413c6b 100644 --- a/.github/workflows/parity-gate.yml +++ b/.github/workflows/parity-gate.yml @@ -48,7 +48,7 @@ jobs: OPENCLAW_LIVE_SETUP_TOKEN_VALUE: "" steps: - name: Checkout PR - uses: actions/checkout@v6 + uses: useblacksmith/checkout@v1 - name: Install pnpm uses: pnpm/action-setup@v4 diff --git a/.github/workflows/sandbox-common-smoke.yml b/.github/workflows/sandbox-common-smoke.yml index 54ff92751eb..4f53f21cdf4 100644 --- a/.github/workflows/sandbox-common-smoke.yml +++ b/.github/workflows/sandbox-common-smoke.yml @@ -30,7 +30,7 @@ jobs: runs-on: blacksmith-16vcpu-ubuntu-2404 steps: - name: Checkout - uses: actions/checkout@v6 + uses: useblacksmith/checkout@v1 with: submodules: false diff --git a/.github/workflows/workflow-sanity.yml b/.github/workflows/workflow-sanity.yml index a2d7b6cc1bd..0c584374fe7 100644 --- a/.github/workflows/workflow-sanity.yml +++ b/.github/workflows/workflow-sanity.yml @@ -22,7 +22,7 @@ jobs: runs-on: blacksmith-16vcpu-ubuntu-2404 steps: - name: Checkout - uses: actions/checkout@v6 + uses: useblacksmith/checkout@v1 - name: Fail on tabs in workflow files run: | @@ -54,7 +54,7 @@ jobs: runs-on: blacksmith-16vcpu-ubuntu-2404 steps: - name: Checkout - uses: actions/checkout@v6 + uses: useblacksmith/checkout@v1 - name: Install actionlint shell: bash @@ -86,7 +86,7 @@ jobs: runs-on: blacksmith-16vcpu-ubuntu-2404 steps: - name: Checkout - uses: actions/checkout@v6 + uses: useblacksmith/checkout@v1 - name: Setup Node environment uses: ./.github/actions/setup-node-env diff --git a/docs/ci.md b/docs/ci.md index d8fdf5b378a..e467fd0f02f 100644 --- a/docs/ci.md +++ b/docs/ci.md @@ -63,6 +63,8 @@ GitHub may mark superseded jobs as `cancelled` when a newer push lands on the sa | `blacksmith-32vcpu-windows-2025` | `checks-windows` | | `macos-latest` | `macos-node`, `macos-swift` | +Blacksmith Linux jobs use `useblacksmith/checkout` so repeat CI runs can reuse the Blacksmith git mirror cache. Windows and macOS jobs stay on upstream `actions/checkout`. + ## Local Equivalents ```bash