build(deps): bump the actions group across 1 directory with 2 updates #17
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Blacksmith Testbox | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| testbox_id: | |
| type: string | |
| description: "Testbox session ID" | |
| required: true | |
| pull_request: | |
| paths: | |
| - ".github/workflows/**" | |
| permissions: | |
| contents: read | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true" | |
| jobs: | |
| check: | |
| permissions: | |
| contents: read | |
| name: "check" | |
| runs-on: blacksmith-32vcpu-ubuntu-2404 | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Begin Testbox | |
| uses: useblacksmith/begin-testbox@v2 | |
| with: | |
| testbox_id: ${{ inputs.testbox_id }} | |
| - 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 30s 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}/5 succeeded" | |
| } | |
| for attempt in 1 2 3 4 5; do | |
| if checkout_attempt "$attempt"; then | |
| exit 0 | |
| fi | |
| echo "checkout attempt ${attempt}/5 failed" | |
| sleep $((attempt * 5)) | |
| done | |
| echo "checkout failed after 5 attempts" >&2 | |
| exit 1 | |
| - name: Setup Node environment | |
| uses: ./.github/actions/setup-node-env | |
| with: | |
| install-bun: "false" | |
| - name: Prepare Testbox shell | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| git fetch --no-tags --depth=50 origin "+refs/heads/main:refs/remotes/origin/main" | |
| node_bin="$(dirname "$(node -p 'process.execPath')")" | |
| pnpm_bin="$(command -v pnpm)" | |
| sudo ln -sf "$node_bin/node" /usr/local/bin/node | |
| sudo ln -sf "$node_bin/npm" /usr/local/bin/npm | |
| sudo ln -sf "$node_bin/npx" /usr/local/bin/npx | |
| sudo ln -sf "$node_bin/corepack" /usr/local/bin/corepack | |
| sudo ln -sf "$pnpm_bin" /usr/local/bin/pnpm | |
| - name: Run Testbox | |
| uses: useblacksmith/run-testbox@v2 | |
| if: always() | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true" |