diff --git a/.github/AGENTS.md b/.github/AGENTS.md index 136957d..0467553 100644 --- a/.github/AGENTS.md +++ b/.github/AGENTS.md @@ -1,11 +1,12 @@ -# Generated by Velnor Actions 0.1.0; edit .velnor/config.toml and regenerate. +# Generated by Velnor Actions 0.1.80; edit .velnor/config.toml and regenerate. # Generated GitHub Workflows and Configurations -All files and subdirectories under `.github/` are generated by `velnor-actions` from [tailrocks/velnor-new](https://github.com/tailrocks/velnor-new). +`velnor-actions` from [tailrocks/velnor-new](https://github.com/tailrocks/velnor-new) owns its declared generated paths, the `.github/workflows/` namespace except the hand-written `release-rust-ci-tools.yml` and regular files directly in `.github/workflows/` whose first line is the `# Generated by velnor-gen.` header, and marked shared action definitions under `.github/actions/`. Successful generation replaces emitted owned paths and retires owned paths no longer emitted. Do not hand-edit these managed paths; change their inputs and run `velnor-actions generate`. -## Do Not Hand-Edit `.github/` +Other existing files and directories under `.github/` are repository-owned and preserved by generation, including empty directories. A directory emptied solely by retiring its managed generated outputs may be pruned. Put custom files outside `.github/workflows/`, which is reserved for generated workflows and the hand-written `release-rust-ci-tools.yml`. Generation refuses to overwrite an unmarked custom action when its path collides with a generated shared action, and a velnor-gen workflow when its path collides with a generated workflow. + +## Generation Inputs -- **Never hand-edit any file inside `.github/`**: Every manual change will be overwritten on the next run of `velnor-actions generate`. - **Keep generation inputs outside `.github/`**: Repository configuration belongs in `.velnor/config.toml`, workspace manifests, and toolchain settings outside `.github/`. - **Regenerate via CLI**: Apply configuration changes by running `velnor-actions generate`. @@ -13,8 +14,8 @@ All files and subdirectories under `.github/` are generated by `velnor-actions` When issues, bugs, limitations, or enhancements are observed in generated GitHub Actions workflows: -1. **Do NOT patch `.github/` directly or create repo-specific workarounds**: - - Avoid local ad-hoc patches, overrides, or shims inside `.github/`. +1. **Do NOT patch generator-owned outputs or create repo-specific workflow workarounds**: + - Avoid local patches, overrides, or shims to managed workflow, config, or action files. 2. **Research generic solutions in `velnor-actions` / `velnor-new`**: - Investigate solutions in the upstream generator: [tailrocks/velnor-new](https://github.com/tailrocks/velnor-new). - Verify that potential changes align with the vision and architectural invariants of Velnor Actions (generic workflow generator, strict safety invariants, zero legacy, fast CI). diff --git a/.github/CLAUDE.md b/.github/CLAUDE.md deleted file mode 120000 index 47dc3e3..0000000 --- a/.github/CLAUDE.md +++ /dev/null @@ -1 +0,0 @@ -AGENTS.md \ No newline at end of file diff --git a/.github/CLAUDE.md b/.github/CLAUDE.md new file mode 100644 index 0000000..43c994c --- /dev/null +++ b/.github/CLAUDE.md @@ -0,0 +1 @@ +@AGENTS.md diff --git a/.github/actionlint.yaml b/.github/actionlint.yaml deleted file mode 100644 index a511b22..0000000 --- a/.github/actionlint.yaml +++ /dev/null @@ -1,7 +0,0 @@ -# Generated by Velnor Actions 0.1.0; edit .velnor/config.toml and regenerate. - -config-variables: [] - -self-hosted-runner: - labels: - - ubuntu-26.04 diff --git a/.github/actions/u26/action.yml b/.github/actions/u26/action.yml new file mode 100644 index 0000000..d58efe5 --- /dev/null +++ b/.github/actions/u26/action.yml @@ -0,0 +1,41 @@ +# Generated by Velnor Actions 0.1.80; edit .velnor/config.toml and regenerate. +name: Velnor Mise cache identity +description: Qualify the hosted image and cache roots before V2 restore. +inputs: + d: + description: Static V2 identity of the tool pins and owned paths. + required: true +outputs: + enabled: + description: Whether the image and absolute roots qualify for restore. + value: ${{ steps.v2.outputs.enabled }} + identity: + description: SHA-256 runtime fingerprint for the qualified host. + value: ${{ steps.v2.outputs.identity }} +runs: + using: composite + steps: + - name: V2 identity + id: v2 + env: + ACTIONS_ID_TOKEN_REQUEST_TOKEN: "" + ACTIONS_ID_TOKEN_REQUEST_URL: "" + ACTIONS_RUNTIME_TOKEN: "" + CARGO_HOME: ${{ runner.temp }}/velnor/cargo + CARGO_REGISTRY_TOKEN: "" + GH_CONFIG_DIR: "" + GH_HOST: "" + GH_TOKEN: "" + GITHUB_TOKEN: "" + MISE_CARGO_HOME: ${{ runner.temp }}/velnor/cargo + MISE_GITHUB_TOKEN: "" + MISE_RUSTUP_HOME: ${{ runner.temp }}/velnor/rustup + NODE_AUTH_TOKEN: "" + NPM_TOKEN: "" + PATH: /usr/bin:/bin:/usr/sbin:/sbin + RUNNER_TEMP: ${{ runner.temp }} + RUSTUP_HOME: ${{ runner.temp }}/velnor/rustup + VELNOR_CACHE_LANE: ubuntu-26.04 + VELNOR_CACHE_STATIC_DIGEST: ${{ inputs.d }} + shell: /bin/bash --noprofile --norc -p -e -o pipefail {0} + run: "function_env_unset=(); function_env_scan_complete=0; while IFS= read -r -d '' env_entry; do case \"$env_entry\" in BASH_FUNC_*=*) function_env_unset+=(-u \"${env_entry%%=*}\");; VELNOR_VERIFIER_ENV_SCAN_COMPLETE) function_env_scan_complete=$((function_env_scan_complete + 1));; esac; done < <({ /usr/bin/env -0 && printf '%s\\000' 'VELNOR_VERIFIER_ENV_SCAN_COMPLETE'; }); [ \"$function_env_scan_complete\" -eq 1 ] || exit 1; exec /usr/bin/env \"${function_env_unset[@]}\" -u BASH_ENV -u ENV -u ACTIONS_ID_TOKEN_REQUEST_TOKEN -u ACTIONS_ID_TOKEN_REQUEST_URL -u ACTIONS_RUNTIME_TOKEN -u GITHUB_TOKEN -u MISE_GITHUB_TOKEN -u GH_TOKEN -u GH_HOST -u GH_CONFIG_DIR PATH=/usr/bin:/bin:/usr/sbin:/sbin /bin/bash --noprofile --norc -p -e -o pipefail -c 'unset ACTIONS_ID_TOKEN_REQUEST_TOKEN ACTIONS_ID_TOKEN_REQUEST_URL ACTIONS_RUNTIME_TOKEN GITHUB_TOKEN MISE_GITHUB_TOKEN GH_TOKEN GH_HOST GH_CONFIG_DIR; /bin/bash \"$GITHUB_ACTION_PATH/../../scripts/velnor-tools-cache-identity.sh\"'" diff --git a/.github/actions/velnor-tool-seed/action.yml b/.github/actions/velnor-tool-seed/action.yml new file mode 100644 index 0000000..5609702 --- /dev/null +++ b/.github/actions/velnor-tool-seed/action.yml @@ -0,0 +1,32 @@ +# Generated by Velnor Actions 0.1.80; edit .velnor/config.toml and regenerate. +name: Restore Velnor tool seed +description: Copy a matching host tool seed into this job. +inputs: + cache_key: + description: Exact Mise cache key. + required: true +outputs: + seed_admitted: + description: True only when the trusted seed matched and was copied. + value: ${{ steps.copy.outputs.seed_admitted }} +runs: + using: composite + steps: + - name: Copy matching tool seed + id: copy + env: + ACTIONS_ID_TOKEN_REQUEST_TOKEN: "" + ACTIONS_ID_TOKEN_REQUEST_URL: "" + ACTIONS_RUNTIME_TOKEN: "" + CARGO_REGISTRY_TOKEN: "" + GH_CONFIG_DIR: "" + GH_HOST: "" + GH_TOKEN: "" + GITHUB_TOKEN: "" + MISE_GITHUB_TOKEN: "" + NODE_AUTH_TOKEN: "" + NPM_TOKEN: "" + PATH: /usr/bin:/bin:/usr/sbin:/sbin + SEED_KEY: ${{ inputs.cache_key }} + shell: /bin/bash --noprofile --norc -p -e -o pipefail {0} + run: "function_env_unset=(); function_env_scan_complete=0; while IFS= read -r -d '' env_entry; do case \"$env_entry\" in BASH_FUNC_*=*) function_env_unset+=(-u \"${env_entry%%=*}\");; VELNOR_VERIFIER_ENV_SCAN_COMPLETE) function_env_scan_complete=$((function_env_scan_complete + 1));; esac; done < <({ /usr/bin/env -0 && printf '%s\\000' 'VELNOR_VERIFIER_ENV_SCAN_COMPLETE'; }); [ \"$function_env_scan_complete\" -eq 1 ] || exit 1; exec /usr/bin/env \"${function_env_unset[@]}\" -u BASH_ENV -u ENV -u ACTIONS_ID_TOKEN_REQUEST_TOKEN -u ACTIONS_ID_TOKEN_REQUEST_URL -u ACTIONS_RUNTIME_TOKEN -u GITHUB_TOKEN -u MISE_GITHUB_TOKEN -u GH_TOKEN -u GH_HOST -u GH_CONFIG_DIR PATH=/usr/bin:/bin:/usr/sbin:/sbin /bin/bash --noprofile --norc -p -e -o pipefail -c 'unset ACTIONS_ID_TOKEN_REQUEST_TOKEN ACTIONS_ID_TOKEN_REQUEST_URL ACTIONS_RUNTIME_TOKEN GITHUB_TOKEN MISE_GITHUB_TOKEN GH_TOKEN GH_HOST GH_CONFIG_DIR; set -euo pipefail; seed=\"/opt/velnor/seed\"; key=\"$SEED_KEY\"; if [ -z \"$key\" ]; then echo \"tool seed disabled\"; exit 0; fi; trusted_seed_owner_root() { if [ \"${RUNNER_OS-}\" = macOS ]; then /usr/bin/stat -f %u \"$1\" | /usr/bin/grep -qx 0; else /usr/bin/stat -c %u -- \"$1\" | /usr/bin/grep -qx 0; fi; }; trusted_seed_file_matches() { local file=\"$1\" expected=\"$2\" actual=\"\" size=\"\" newline=\"\"; [ -f \"$file\" ] && [ ! -L \"$file\" ] || return 1; if [ \"${RUNNER_OS-}\" = macOS ]; then IFS= read -r size < <(/usr/bin/stat -f %z \"$file\") || return 1; else IFS= read -r size < <(/usr/bin/stat -c %s -- \"$file\") || return 1; fi; case \"$size\" in '\\'''\\''|*[!0-9]*) return 1 ;; esac; [ \"$size\" -le 512 ] || return 1; if IFS= read -r -d '\\'''\\'' actual < \"$file\"; then return 1; fi; printf -v newline '\\''\\n'\\''; [ \"$actual\" = \"$expected\" ] || [ \"$actual\" = \"$expected$newline\" ]; }; trusted_seed_path_is_real() { local current=\"$1\"; while [ \"$current\" != / ]; do [ ! -L \"$current\" ] || return 1; current=\"${current%/*}\"; [ -n \"$current\" ] || current=/; done; }; trusted_seed_mount_is_immutable() { if [ \"${RUNNER_OS-}\" = macOS ]; then /sbin/mount | /usr/bin/awk -v seed=\"$1\" '\\''index($0, \" on \") { marker=index($0, \" on \"); source=substr($0, 1, marker-1); rest=substr($0, marker+4); options_at=index(rest, \" (\"); target=substr(rest, 1, options_at-1); mount_options=substr(rest, options_at+2); targets[NR]=target; sources[NR]=source; options[NR]=mount_options; if (target == seed) { exact++; seed_source=source; if (mount_options ~ /read-only|rdonly/) readonly=1 } else if (index(target, seed \"/\") == 1) nested=1 } END { for (i=1; i<=NR; i++) if (sources[i] == seed_source && targets[i] != seed && options[i] !~ /read-only|rdonly/) writable_alias=1; exit !(exact == 1 && readonly && !nested && !writable_alias) }'\\''; else /usr/bin/findmnt -arn -o TARGET,FSTYPE,MAJ:MIN,OPTIONS | /usr/bin/awk -v seed=\"$1\" '\\''{ target=$1; targets[NR]=target; devices[NR]=$3; options[NR]=$4; if (target == seed) { exact++; device=$3; if ($2 != \"overlay\" && $2 != \"fuse.overlayfs\" && $4 ~ /(^|,)ro(,|$)/) readonly=1 } else if (index(target, seed \"/\") == 1) nested=1 } END { for (i=1; i<=NR; i++) if (devices[i] == device && targets[i] != seed && options[i] ~ /(^|,)rw(,|$)/) writable_alias=1; exit !(exact == 1 && readonly && !nested && !writable_alias) }'\\''; fi; }; trusted_seed_tree_bounded() { local root=\"$1\" count=0 entry relative depth; if ! /usr/bin/find \"$root\" -xdev -print0 | while IFS= read -r -d '\\'''\\'' entry; do ((count+=1)); [ \"$count\" -le 100000 ] || exit 1; case \"$entry\" in \"$root\") depth=0 ;; \"$root\"/*) relative=\"${entry#\"$root\"/}\"; depth=1; while [[ \"$relative\" == */* ]]; do relative=\"${relative#*/}\"; ((depth+=1)); done ;; *) exit 1 ;; esac; [ \"$depth\" -le 16 ] || exit 1; done; then return 1; fi; }; trusted_seed_tree_entries_are_safe() { if ! /usr/bin/find \"$1\" -xdev \\( ! -type d -a ! -type f -o ! -uid 0 \\) -print0 | while IFS= read -r -d '\\'''\\'' entry; do exit 1; done; then return 1; fi; }; trusted_seed_tree_is_safe() { trusted_seed_tree_bounded \"$1\" && trusted_seed_tree_entries_are_safe \"$1\"; }; trusted_seed_is_trusted() { [ -d \"$1\" ] && [ ! -L \"$1\" ] || return 1; trusted_seed_path_is_real \"$1\" || return 1; [ -f \"$1/PROVENANCE\" ] && [ ! -L \"$1/PROVENANCE\" ] || return 1; trusted_seed_owner_root \"$1\" || return 1; trusted_seed_owner_root \"$1/PROVENANCE\" || return 1; trusted_seed_file_matches \"$1/PROVENANCE\" \"velnor-host-seed-v1\" || return 1; trusted_seed_mount_is_immutable \"$1\" || return 1; trusted_seed_tree_is_safe \"$1\"; }; if [ ! -e \"$seed\" ]; then echo \"tool seed absent\"; exit 0; fi; if ! trusted_seed_is_trusted \"$seed\"; then echo \"untrusted tool seed; continuing cold\"; exit 0; fi; if [[ ! \"$key\" =~ ^mise-tools-v2-[0-9a-f]{64}$ ]] || [ ! -f \"$seed/mise/KEY\" ]; then echo \"tool seed key mismatch\"; exit 0; fi; if ! trusted_seed_file_matches \"$seed/mise/KEY\" \"$key\"; then echo \"tool seed key mismatch\"; exit 0; fi; trusted_seed_tree_has_file() { /usr/bin/find \"$1\" -type f -print -quit | /usr/bin/grep -q .; }; copied=false; if [ -d \"$seed/mise/tree\" ] && trusted_seed_tree_has_file \"$seed/mise/tree\"; then /bin/mkdir -p \"$HOME/.local/share/mise\"; /bin/cp -R \"$seed/mise/tree/.\" \"$HOME/.local/share/mise/\"; echo \"tool seed restored share-dir\"; copied=true; fi; if [ -d \"$seed/rustup/tree\" ] && trusted_seed_tree_has_file \"$seed/rustup/tree\"; then /bin/mkdir -p \"$RUNNER_TEMP/velnor/rustup\"; /bin/cp -R \"$seed/rustup/tree/.\" \"$RUNNER_TEMP/velnor/rustup/\"; echo \"tool seed restored toolchain-dir\"; copied=true; fi; [ \"$copied\" = true ] || { echo \"tool seed has no copyable payload\"; exit 0; }; printf '\\''seed_admitted=true\\n'\\'' >> \"$GITHUB_OUTPUT\"'" diff --git a/.github/actions/velnor-tools-cache-restore/action.yml b/.github/actions/velnor-tools-cache-restore/action.yml new file mode 100644 index 0000000..a940636 --- /dev/null +++ b/.github/actions/velnor-tools-cache-restore/action.yml @@ -0,0 +1,55 @@ +# Generated by Velnor Actions 0.1.80; edit .velnor/config.toml and regenerate. +name: Velnor Mise tools cache restore +description: Restore the exact renderer-owned V2 Mise tools paths. +inputs: + key: + description: Exact runtime-qualified V2 tools key. + required: true + mise-sha256: + description: Pinned SHA-256 of the Setup Mise binary. + required: true + seed-admitted: + description: Whether the trusted V2 prelude copied the exact seed. + required: false + default: "false" +outputs: + cache-hit: + description: Exact-key hit of the restored V2 tools entry. + value: ${{ steps.restore.outputs.cache-hit }} + origin-bytes: + description: Origin bytes downloaded while re-verifying restored Mise installs; empty when unmeasured. + value: ${{ steps.verify.outputs.origin-bytes }} + origin-fetches: + description: Origin archive downloads while re-verifying restored Mise installs. + value: ${{ steps.verify.outputs.origin-fetches }} + reused-archives: + description: Verified local tool archives reused without an origin download. + value: ${{ steps.verify.outputs.reused-archives }} + verified-files: + description: Restored install files verified against trusted archives. + value: ${{ steps.verify.outputs.verified-files }} +runs: + using: composite + steps: + - name: Restore Mise tools + id: restore + uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 + with: + key: ${{ inputs.key }} + path: "~/.local/share/mise\n${{ runner.temp }}/velnor/rustup\n${{ runner.temp }}/velnor/cargo/.crates.toml\n${{ runner.temp }}/velnor/cargo/.crates2.json\n${{ runner.temp }}/velnor/cargo/bin" + restore-keys: "" + - name: Keep only an exact cache hit or validated seed on a miss + shell: /bin/bash --noprofile --norc -p -e -o pipefail {0} + env: + TOOLS_CACHE_HIT: ${{ steps.restore.outputs.cache-hit }} + TOOLS_EXPECTED_KEY: ${{ inputs.key }} + TOOLS_MATCHED_KEY: ${{ steps.restore.outputs.cache-matched-key }} + TOOLS_SEED_ADMITTED: ${{ inputs.seed-admitted }} + TOOLS_MISE_SHA256: ${{ inputs.mise-sha256 }} + run: "set -eu;\nPATH=/usr/bin:/bin:/usr/sbin:/sbin;\nexport PATH;\n[ -n \"$HOME\" ] && [ -n \"$RUNNER_TEMP\" ] || exit 1;\ncase \"$HOME\" in /*) ;; *) exit 1 ;; esac;\ncase \"$RUNNER_TEMP\" in /*) ;; *) exit 1 ;; esac;\n[ \"$HOME\" != / ] && [ \"$RUNNER_TEMP\" != / ] || exit 1;\ncache_hit=\"${TOOLS_CACHE_HIT-}\";\nexpected_key=\"${TOOLS_EXPECTED_KEY-}\";\nmatched_key=\"${TOOLS_MATCHED_KEY-}\";\nseed_admitted=\"${TOOLS_SEED_ADMITTED-}\";\nmise_sha256=\"${TOOLS_MISE_SHA256-}\";\nmise_root=\"$HOME/.local/share/mise\";\n[[ \"$mise_sha256\" =~ ^[0-9a-f]{64}$ ]] || exit 1;\nverify_mise() {\n[ ! -L \"$mise_root\" ] && [ ! -L \"$mise_root/bin\" ] && [ -d \"$mise_root/bin\" ] && [ ! -L \"$mise_root/bin/mise\" ] && [ -f \"$mise_root/bin/mise\" ] || { echo \"Setup Mise binary is missing\" >&2; exit 1; };\nwhile IFS= read -r -d '' entry; do\nname=${entry##*/};\ncase \"$name\" in\nmise) ;;\nmise-version) [ -f \"$entry\" ] && [ ! -L \"$entry\" ] && [ ! -x \"$entry\" ] || { echo \"mise-version is not a plain Setup Mise record\" >&2; exit 1; } ;;\n*) printf '%s is not part of the Setup Mise install\\n' \"bin/$name\" >&2; exit 1 ;;\nesac;\ndone < <(find \"$mise_root/bin\" -mindepth 1 -maxdepth 1 -print0);\nif command -v sha256sum >/dev/null 2>&1; then actual=$(sha256sum \"$mise_root/bin/mise\"); else actual=$(shasum -a 256 \"$mise_root/bin/mise\"); fi;\n[ \"${actual%% *}\" = \"$mise_sha256\" ] || { echo \"Mise binary does not match its pinned SHA-256\" >&2; exit 1; };\n};\nkeep=false;\nif [ \"$cache_hit\" = true ] && [[ \"$expected_key\" =~ ^mise-tools-v2-[0-9a-f]{64}$ ]] && [ \"$matched_key\" = \"$expected_key\" ]; then\nkeep=true;\nelif [ -z \"$cache_hit\" ] && [[ \"$expected_key\" =~ ^mise-tools-v2-[0-9a-f]{64}$ ]] && [ -z \"$matched_key\" ] && [ \"$seed_admitted\" = true ]; then\nkeep=true;\nfi;\nif [ \"$keep\" = true ]; then\n[ ! -L \"$HOME/.local/share/mise\" ] || exit 1;\n[ ! -L \"$RUNNER_TEMP/velnor/rustup\" ] || exit 1;\n[ ! -L \"$RUNNER_TEMP/velnor/cargo/bin\" ] || exit 1;\n[ ! -L \"$RUNNER_TEMP/velnor/cargo/.crates.toml\" ] || exit 1;\n[ ! -L \"$RUNNER_TEMP/velnor/cargo/.crates2.json\" ] || exit 1;\nverify_mise;\nexit 0;\nfi;\n[ ! -L \"$mise_root\" ] || exit 1;\nif [ -d \"$mise_root\" ]; then\nfind \"$mise_root\" -mindepth 1 -maxdepth 1 ! -name bin -exec rm -rf {} +;\nfi;\nfor d in \"$RUNNER_TEMP/velnor/rustup\" \"$RUNNER_TEMP/velnor/cargo/bin\"; do\n[ ! -L \"$d\" ] || exit 1;\nrm -rf \"$d\";\ndone;\nfor f in \"$RUNNER_TEMP/velnor/cargo/.crates.toml\" \"$RUNNER_TEMP/velnor/cargo/.crates2.json\"; do\n[ ! -L \"$f\" ] || exit 1;\nrm -f \"$f\";\ndone;\nverify_mise" + - name: Re-verify restored Mise installs + id: verify + shell: /bin/bash --noprofile --norc -p -e -o pipefail {0} + env: + VELNOR_TOOL_PINS: "jactionlint 2.4.0 linux-arm64 https://github.com/jdx/jactionlint/releases/download/v2.4.0/jactionlint_2.4.0_linux_arm64.tar.gz 42413391c248f99ff4550d6c866ee717d5ea4ca2b966d9d54ad1503af955e22f\njactionlint 2.4.0 linux-x64 https://github.com/jdx/jactionlint/releases/download/v2.4.0/jactionlint_2.4.0_linux_amd64.tar.gz 26ddba81db28fffc51163175c070ee1a9d1150260de4b5232f01d9b749f32d8e\njactionlint 2.4.0 macos-arm64 https://github.com/jdx/jactionlint/releases/download/v2.4.0/jactionlint_2.4.0_darwin_arm64.tar.gz 349a13dbffdd25376898a256d195806afda08ba97ccc6378cbf2dd11a77ef8e7\njactionlint 2.4.0 macos-x64 https://github.com/jdx/jactionlint/releases/download/v2.4.0/jactionlint_2.4.0_darwin_amd64.tar.gz 4c21fce834f8267b65a65b32a527aaa2ec1c321c8f066d44b42d7f038835aa90\nopentofu 1.13.8 linux-x64 https://github.com/opentofu/opentofu/releases/download/v1.13.8/tofu_1.13.8_linux_amd64.tar.gz dab8135df87343ce143e1bef1a6174d7b82035950818bde17950658ff9a72697\nopentofu 1.13.8 linux-arm64 https://github.com/opentofu/opentofu/releases/download/v1.13.8/tofu_1.13.8_linux_arm64.tar.gz fb4a3cbae5eba5a07f16e53bdf61493d2da81b4a559f645b39761409a7abc2ea\nopentofu 1.13.8 macos-x64 https://github.com/opentofu/opentofu/releases/download/v1.13.8/tofu_1.13.8_darwin_amd64.tar.gz 1e829e672127cef6c712496adb161c22d5b85775a96f3ae1b3749151ea55e9fb\nopentofu 1.13.8 macos-arm64 https://github.com/opentofu/opentofu/releases/download/v1.13.8/tofu_1.13.8_darwin_arm64.tar.gz dc53f79995cb235a3f68e87d3856f37179a091a9c75ff4eaf1d5ebf0006e4cf4\nhttp-cargo-machete 0.9.2 linux-x64 https://github.com/bnjbvr/cargo-machete/releases/download/v0.9.2/cargo-machete-v0.9.2-x86_64-unknown-linux-musl.tar.gz 48200087f54c55aabcd4db4af1e25742b49846c02a1b1bfa134711945b35b2e9\nhttp-lychee 0.15.1 linux-x64 https://github.com/lycheeverse/lychee/releases/download/v0.15.1/lychee-v0.15.1-x86_64-unknown-linux-gnu.tar.gz 9afdf0f48064fdcd8a8815ca6d2d9fcd43a0ef4c2edf9da23d6f7bf46a764eb8" + run: "# SPDX-FileCopyrightText: 2026 Alexey Zhokhov\n# SPDX-License-Identifier: Apache-2.0\n\nset -euo pipefail\n# Setup Mise already put the restored `bin/` and `shims/` on PATH ahead of\n# the system directories, so every helper comes from root-owned system\n# directories only (the step's shell is an absolute path for the same reason).\nPATH=/usr/bin:/bin:/usr/sbin:/sbin\nexport PATH\nroot=\"$HOME/.local/share/mise\"\ninstalls=\"$root/installs\"\narchives=\"$installs/.velnor-verified-archives\"\nlock=\"${GITHUB_WORKSPACE:-$PWD}/mise.lock\"\n# Code Mise could run that no lock pins: rebuilt on demand, never restored.\nrm -rf \"$root/plugins\" \"$root/shims\"\n[ ! -L \"$installs\" ] || rm -f \"$installs\"\n[ -d \"$installs\" ] || exit 0\n[ ! -L \"$archives\" ] || rm -f \"$archives\"\ncase \"${RUNNER_OS:-}-${RUNNER_ARCH:-}\" in\n Linux-X64) platform=linux-x64 ;;\n Linux-ARM64) platform=linux-arm64 ;;\n macOS-ARM64) platform=macos-arm64 ;;\n macOS-X64) platform=macos-x64 ;;\n *) platform= ;;\nesac\nif command -v sha256sum >/dev/null 2>&1; then h=(sha256sum); else h=(shasum -a 256); fi\nwork=$(mktemp -d)\ntrap 'rm -rf \"$work\"' EXIT\norigin_fetches=0\norigin_bytes=0\norigin_bytes_unknown=\nreused_archives=0\nverified_files=0\n# ` ` for this platform.\n: > \"$work/pins\"\ncatalog_pins() { printf '%s\\n' \"${VELNOR_TOOL_PINS:-}\" | awk -v p=\"$platform\" 'NF == 5 && $3 == p { print $1, $2, $4, \"sha256:\" $5 }'; }\nlock_pins() {\n awk -v want=\"platforms.$platform\" '\n function unq(s) { gsub(/^\"|\"$/, \"\", s); return s }\n function flush() { if (section && url != \"\" && sum != \"\") print dir, version, url, sum; section = 0; url = \"\"; sum = \"\" }\n /^\\[\\[tools\\./ { flush(); name = $0; sub(/^\\[\\[tools\\./, \"\", name); sub(/\\]\\]$/, \"\", name); name = unq(name); dir = name; gsub(/[:\\/]/, \"-\", dir); version = \"\"; next }\n /^\\[tools\\./ { flush(); s = $0; n = index(s, \"\\\"platforms.\"); if (n > 0) { p = substr(s, n + 1); sub(/\"\\]$/, \"\", p); section = (p == want) } ; next }\n /^\\[/ { flush(); next }\n $1 == \"version\" && !section { version = unq($3) }\n section && $1 == \"url\" { url = unq($3) }\n section && $1 == \"checksum\" { sum = unq($3) }\n END { flush() }\n ' \"$lock\"\n}\n[ -z \"$platform\" ] || catalog_pins > \"$work/pins\"\nif [ -n \"$platform\" ] && [ -f \"$lock\" ] && [ ! -L \"$lock\" ]; then lock_pins >> \"$work/pins\"; fi\ndiscard() { printf 'velnor: discarding restored %s: %s; Prepare pinned tools reinstalls it\\n' \"$1\" \"$2\"; rm -rf \"$3\"; }\nverify_install() {\n local dir=$1 tool=$2 version=$3 url sum line archive x link target stored size n\n case \"$tool$version\" in *[!A-Za-z0-9._+-]*) echo \"unsafe name\"; return 1 ;; esac\n line=$(awk -v t=\"$tool\" -v v=\"$version\" '$1 == t && $2 == v { print $3, $4; exit }' \"$work/pins\")\n [ -n \"$line\" ] || { echo \"no mise.lock or catalog pin for ${platform:-this runner}\"; return 1; }\n url=${line%% *}; sum=${line#* }\n case \"$sum\" in sha256:*) sum=${sum#sha256:} ;; *) echo \"mise.lock checksum is not SHA-256\"; return 1 ;; esac\n case \"$url\" in https://*) ;; *) echo \"mise.lock URL is not HTTPS\"; return 1 ;; esac\n case \"$sum\" in '' | *[!0-9a-f]*) echo \"mise.lock checksum is not SHA-256\"; return 1 ;; esac\n [ \"${#sum}\" -eq 64 ] || { echo \"mise.lock checksum is not SHA-256\"; return 1; }\n stored=\"$archives/$sum\"\n archive=\"$work/archive\"\n rm -rf \"$archive\" \"$work/x\"; mkdir -p \"$work/x\"\n if [ -f \"$stored\" ] && [ ! -L \"$stored\" ] && [ \"$(\"${h[@]}\" \"$stored\" | cut -d\" \" -f1)\" = \"$sum\" ]; then\n printf 'velnor: reusing verified %s@%s archive; no origin download\\n' \"$tool\" \"$version\"\n archive=\"$stored\"\n reused_archives=$((reused_archives + 1))\n else\n rm -f \"$stored\"\n curl --proto '=https' --proto-redir '=https' --tlsv1.2 --fail --silent --show-error --location --retry 3 --output \"$archive\" \"$url\" \\\n || { echo \"download failed\"; return 1; }\n [ \"$(\"${h[@]}\" \"$archive\" | cut -d\" \" -f1)\" = \"$sum\" ] || { echo \"archive does not match the mise.lock checksum\"; return 1; }\n origin_fetches=$((origin_fetches + 1))\n size=$(wc -c < \"$archive\" | tr -d ' ')\n case \"$size\" in '' | *[!0-9]*) origin_bytes_unknown=1 ;; *) origin_bytes=$((origin_bytes + size)) ;; esac\n mkdir -p \"$archives\"\n cp \"$archive\" \"$stored\"\n fi\n case \"$url\" in\n *.tar.gz|*.tgz) tar -xzf \"$archive\" -C \"$work/x\" ;;\n *.tar.xz|*.txz) tar -xJf \"$archive\" -C \"$work/x\" ;;\n *.tar.bz2|*.tbz2) tar -xjf \"$archive\" -C \"$work/x\" ;;\n *.tar) tar -xf \"$archive\" -C \"$work/x\" ;;\n *.zip) unzip -q \"$archive\" -d \"$work/x\" ;;\n *.gz) gunzip -c \"$archive\" > \"$work/x/file\" ;;\n *) cp \"$archive\" \"$work/x/file\" ;;\n esac || { echo \"archive does not extract\"; return 1; }\n (cd \"$work/x\" && find . -type f -exec \"${h[@]}\" {} +) | cut -d' ' -f1 | LC_ALL=C sort -u > \"$work/archive.sums\"\n if [ -n \"$(find \"$dir\" ! -type f ! -type d ! -type l -print -quit)\" ]; then echo \"special file\"; return 1; fi\n while IFS= read -r -d '' link; do\n target=$(readlink \"$link\") || { echo \"unreadable symlink\"; return 1; }\n case \"$target\" in\n ..|../*|*/../*|*/..) echo \"symlink ${link#\"$dir\"/} leaves the install\"; return 1 ;;\n \"$dir\"/*) ;;\n /*) echo \"symlink ${link#\"$dir\"/} leaves the install\"; return 1 ;;\n esac\n done < <(find \"$dir\" -type l -print0)\n # Mise's own bookkeeping under `.mise-*` (the packslip statement, shell\n # completions, `.mise-bins` links checked above) is data that CI never runs;\n # it may hold no executable file.\n if [ -n \"$(cd \"$dir\" && find . -path './.mise-*' -type f -perm -u+x -print -quit)\" ]; then\n echo \"executable file in Mise bookkeeping\"; return 1\n fi\n (cd \"$dir\" && find . -type f ! -path './.mise-*' -exec \"${h[@]}\" {} +) \\\n | cut -d' ' -f1 | LC_ALL=C sort -u > \"$work/install.sums\"\n x=$(LC_ALL=C comm -23 \"$work/install.sums\" \"$work/archive.sums\" | head -n 1)\n [ -z \"$x\" ] || { echo \"a file differs from the pinned archive\"; return 1; }\n n=$(wc -l < \"$work/install.sums\" | tr -d ' ')\n case \"$n\" in '' | *[!0-9]*) ;; *) verified_files=$((verified_files + n)) ;; esac\n}\n# Every entry, dot-named ones included (a glob skips those), is verified or\n# discarded: tool directories, version directories and aliases alike.\nentries() { find \"$1\" -mindepth 1 -maxdepth 1 -print0; }\nwhile IFS= read -r -d '' tool_dir; do\n [ -d \"$tool_dir\" ] && [ ! -L \"$tool_dir\" ] || { rm -rf \"$tool_dir\"; continue; }\n tool=${tool_dir##*/}\n case \"$tool\" in rust|core-rust|.velnor-verified-archives) continue ;; esac\n # Real version directories first, so an alias is judged by a verified one.\n verified=\" \"\n while IFS= read -r -d '' dir; do\n [ ! -L \"$dir\" ] || continue\n version=${dir##*/}\n if [ ! -d \"$dir\" ]; then\n # Mise's per-tool backend record is data; any other file is dropped.\n [ \"$version\" = .mise.backend.toml ] && [ -f \"$dir\" ] && [ ! -x \"$dir\" ] || rm -rf \"$dir\"\n continue\n fi\n if verify_install \"$dir\" \"$tool\" \"$version\" >\"$work/verify.out\" 2>&1; then\n cat \"$work/verify.out\"\n verified=\"$verified$version \"\n printf 'velnor: restored %s@%s matches its mise.lock archive\\n' \"$tool\" \"$version\"\n else\n reason=$(cat \"$work/verify.out\")\n discard \"$tool@$version\" \"${reason:-verification failed}\" \"$dir\"\n fi\n done < <(entries \"$tool_dir\")\n # A version alias (`1.26 -> ./1.26.0`) is kept only when it names a sibling\n # version directory verified above; a chain, a path or a dangling link is not.\n while IFS= read -r -d '' dir; do\n [ -L \"$dir\" ] || continue\n target=$(readlink \"$dir\")\n target=${target#./}\n case \"$target\" in ''|.|..|*/*) rm -f \"$dir\"; continue ;; esac\n case \"$verified\" in *\" $target \"*) ;; *) rm -f \"$dir\"; continue ;; esac\n [ -d \"$tool_dir/$target\" ] && [ ! -L \"$tool_dir/$target\" ] || rm -f \"$dir\"\n done < <(entries \"$tool_dir\")\ndone < <(entries \"$installs\")\nif [ -n \"${GITHUB_OUTPUT-}\" ]; then\n [ -n \"$origin_bytes_unknown\" ] || printf 'origin-bytes=%s\\n' \"$origin_bytes\" >> \"$GITHUB_OUTPUT\"\n printf 'origin-fetches=%s\\nreused-archives=%s\\nverified-files=%s\\n' \"$origin_fetches\" \"$reused_archives\" \"$verified_files\" >> \"$GITHUB_OUTPUT\"\nfi\nif [ -n \"${GITHUB_STEP_SUMMARY-}\" ]; then\n {\n printf 'velnor tools verify: origin-fetches=%s ' \"$origin_fetches\"\n [ -n \"$origin_bytes_unknown\" ] || printf 'origin-bytes=%s ' \"$origin_bytes\"\n printf 'reused-archives=%s verified-files=%s\\n' \"$reused_archives\" \"$verified_files\"\n } >> \"$GITHUB_STEP_SUMMARY\"\nfi\n" diff --git a/.github/actions/velnor-tools-cache-scrub/action.yml b/.github/actions/velnor-tools-cache-scrub/action.yml new file mode 100644 index 0000000..144efae --- /dev/null +++ b/.github/actions/velnor-tools-cache-scrub/action.yml @@ -0,0 +1,19 @@ +# Generated by Velnor Actions 0.1.80; edit .velnor/config.toml and regenerate. +name: Velnor Mise tools cache scrub +description: Scrub the Mise tools paths to the verified Setup Mise install before a producer installs and saves. +inputs: + mise-sha256: + description: Pinned SHA-256 of the Setup Mise binary. + required: true +runs: + using: composite + steps: + - name: Keep only an exact cache hit or validated seed on a miss + shell: /bin/bash --noprofile --norc -p -e -o pipefail {0} + env: + TOOLS_CACHE_HIT: "false" + TOOLS_EXPECTED_KEY: "" + TOOLS_MATCHED_KEY: "" + TOOLS_SEED_ADMITTED: "false" + TOOLS_MISE_SHA256: ${{ inputs.mise-sha256 }} + run: "set -eu;\nPATH=/usr/bin:/bin:/usr/sbin:/sbin;\nexport PATH;\n[ -n \"$HOME\" ] && [ -n \"$RUNNER_TEMP\" ] || exit 1;\ncase \"$HOME\" in /*) ;; *) exit 1 ;; esac;\ncase \"$RUNNER_TEMP\" in /*) ;; *) exit 1 ;; esac;\n[ \"$HOME\" != / ] && [ \"$RUNNER_TEMP\" != / ] || exit 1;\ncache_hit=\"${TOOLS_CACHE_HIT-}\";\nexpected_key=\"${TOOLS_EXPECTED_KEY-}\";\nmatched_key=\"${TOOLS_MATCHED_KEY-}\";\nseed_admitted=\"${TOOLS_SEED_ADMITTED-}\";\nmise_sha256=\"${TOOLS_MISE_SHA256-}\";\nmise_root=\"$HOME/.local/share/mise\";\n[[ \"$mise_sha256\" =~ ^[0-9a-f]{64}$ ]] || exit 1;\nverify_mise() {\n[ ! -L \"$mise_root\" ] && [ ! -L \"$mise_root/bin\" ] && [ -d \"$mise_root/bin\" ] && [ ! -L \"$mise_root/bin/mise\" ] && [ -f \"$mise_root/bin/mise\" ] || { echo \"Setup Mise binary is missing\" >&2; exit 1; };\nwhile IFS= read -r -d '' entry; do\nname=${entry##*/};\ncase \"$name\" in\nmise) ;;\nmise-version) [ -f \"$entry\" ] && [ ! -L \"$entry\" ] && [ ! -x \"$entry\" ] || { echo \"mise-version is not a plain Setup Mise record\" >&2; exit 1; } ;;\n*) printf '%s is not part of the Setup Mise install\\n' \"bin/$name\" >&2; exit 1 ;;\nesac;\ndone < <(find \"$mise_root/bin\" -mindepth 1 -maxdepth 1 -print0);\nif command -v sha256sum >/dev/null 2>&1; then actual=$(sha256sum \"$mise_root/bin/mise\"); else actual=$(shasum -a 256 \"$mise_root/bin/mise\"); fi;\n[ \"${actual%% *}\" = \"$mise_sha256\" ] || { echo \"Mise binary does not match its pinned SHA-256\" >&2; exit 1; };\n};\nkeep=false;\nif [ \"$cache_hit\" = true ] && [[ \"$expected_key\" =~ ^mise-tools-v2-[0-9a-f]{64}$ ]] && [ \"$matched_key\" = \"$expected_key\" ]; then\nkeep=true;\nelif [ -z \"$cache_hit\" ] && [[ \"$expected_key\" =~ ^mise-tools-v2-[0-9a-f]{64}$ ]] && [ -z \"$matched_key\" ] && [ \"$seed_admitted\" = true ]; then\nkeep=true;\nfi;\nif [ \"$keep\" = true ]; then\n[ ! -L \"$HOME/.local/share/mise\" ] || exit 1;\n[ ! -L \"$RUNNER_TEMP/velnor/rustup\" ] || exit 1;\n[ ! -L \"$RUNNER_TEMP/velnor/cargo/bin\" ] || exit 1;\n[ ! -L \"$RUNNER_TEMP/velnor/cargo/.crates.toml\" ] || exit 1;\n[ ! -L \"$RUNNER_TEMP/velnor/cargo/.crates2.json\" ] || exit 1;\nverify_mise;\nexit 0;\nfi;\n[ ! -L \"$mise_root\" ] || exit 1;\nif [ -d \"$mise_root\" ]; then\nfind \"$mise_root\" -mindepth 1 -maxdepth 1 ! -name bin -exec rm -rf {} +;\nfi;\nfor d in \"$RUNNER_TEMP/velnor/rustup\" \"$RUNNER_TEMP/velnor/cargo/bin\"; do\n[ ! -L \"$d\" ] || exit 1;\nrm -rf \"$d\";\ndone;\nfor f in \"$RUNNER_TEMP/velnor/cargo/.crates.toml\" \"$RUNNER_TEMP/velnor/cargo/.crates2.json\"; do\n[ ! -L \"$f\" ] || exit 1;\nrm -f \"$f\";\ndone;\nverify_mise" diff --git a/.github/actions/velnor-tools-prelude-u26/action.yml b/.github/actions/velnor-tools-prelude-u26/action.yml new file mode 100644 index 0000000..b75f09a --- /dev/null +++ b/.github/actions/velnor-tools-prelude-u26/action.yml @@ -0,0 +1,28 @@ +# Generated by Velnor Actions 0.1.80; edit .velnor/config.toml and regenerate. +name: Velnor hosted tools prelude +description: Qualify the hosted image and copy a matching tool seed. +inputs: + d: + description: Static V2 identity of the tool pins and owned paths. + required: true +outputs: + enabled: + value: ${{ steps.v2.outputs.enabled }} + identity: + value: ${{ steps.v2.outputs.identity }} + seed_admitted: + value: ${{ steps.seed.outputs.seed_admitted }} +runs: + using: composite + steps: + - name: V2 identity + id: v2 + uses: ./.github/actions/u26 # zizmor: ignore[self-repository] + with: + d: ${{ inputs.d }} + - name: Restore Velnor tool seed + id: seed + if: steps.v2.outputs.enabled == 'true' + uses: ./.github/actions/velnor-tool-seed # zizmor: ignore[self-repository] + with: + cache_key: mise-tools-v2-${{steps.v2.outputs.identity}} diff --git a/.github/actions/velnor-verify-jactionlint/action.yml b/.github/actions/velnor-verify-jactionlint/action.yml new file mode 100644 index 0000000..f89b055 --- /dev/null +++ b/.github/actions/velnor-verify-jactionlint/action.yml @@ -0,0 +1,22 @@ +# Generated by Velnor Actions 0.1.80; edit .velnor/config.toml and regenerate. +name: Velnor jactionlint executable verifier +description: Shared steps for Velnor jactionlint executable verifier +runs: + using: composite + steps: + - name: Verify jactionlint + env: + ACTIONS_ID_TOKEN_REQUEST_TOKEN: "" + ACTIONS_ID_TOKEN_REQUEST_URL: "" + ACTIONS_RUNTIME_TOKEN: "" + CARGO_REGISTRY_TOKEN: "" + GH_CONFIG_DIR: "" + GH_HOST: "" + GH_TOKEN: "" + GITHUB_TOKEN: "" + MISE_GITHUB_TOKEN: "" + NODE_AUTH_TOKEN: "" + NPM_TOKEN: "" + PATH: /usr/bin:/bin:/usr/sbin:/sbin + shell: /bin/bash --noprofile --norc -p -e -o pipefail {0} + run: "function_env_unset=(); function_env_scan_complete=0; while IFS= read -r -d '' env_entry; do case \"$env_entry\" in BASH_FUNC_*=*) function_env_unset+=(-u \"${env_entry%%=*}\");; VELNOR_VERIFIER_ENV_SCAN_COMPLETE) function_env_scan_complete=$((function_env_scan_complete + 1));; esac; done < <({ /usr/bin/env -0 && printf '%s\\000' 'VELNOR_VERIFIER_ENV_SCAN_COMPLETE'; }); [ \"$function_env_scan_complete\" -eq 1 ] || exit 1; exec /usr/bin/env \"${function_env_unset[@]}\" -u BASH_ENV -u ENV -u ACTIONS_ID_TOKEN_REQUEST_TOKEN -u ACTIONS_ID_TOKEN_REQUEST_URL -u ACTIONS_RUNTIME_TOKEN -u GITHUB_TOKEN -u MISE_GITHUB_TOKEN -u GH_TOKEN -u GH_HOST -u GH_CONFIG_DIR PATH=/usr/bin:/bin:/usr/sbin:/sbin /bin/bash --noprofile --norc -p -e -o pipefail -c 'unset ACTIONS_ID_TOKEN_REQUEST_TOKEN ACTIONS_ID_TOKEN_REQUEST_URL ACTIONS_RUNTIME_TOKEN GITHUB_TOKEN MISE_GITHUB_TOKEN GH_TOKEN GH_HOST GH_CONFIG_DIR; set -eu; PATH=\"/usr/bin:/bin:/usr/sbin:/sbin\"; export PATH; v=\"2.4.0\"; case \"${RUNNER_OS-}-${RUNNER_ARCH-}\" in Linux-X64) p=linux-x64;; Linux-ARM64) p=linux-arm64;; macOS-ARM64) p=macos-arm64;; macOS-X64) p=macos-x64;; *) p=unsupported;; esac; case \"$v/$p\" in 2.4.0/linux-arm64) want=5be2560b719b1764a7ff9a5983cd47dd0bd0f538cb35baed8d598c536e0cee35;; 2.4.0/linux-x64) want=70e41eb37cdd89a305f9a433e230976732fe2ef5f674bbea8d68322ae583bdd0;; 2.4.0/macos-arm64) want=4dff3e799bd47c5b19363c1c7d6f86d09cc2ce41112aede55fb1bfc982eb8643;; 2.4.0/macos-x64) want=39bbd9e4bf6302fa92bc12cebf933b26fad58b6e76d8468c464ae3880f2ef453;; *) want=;; esac; if [ -z \"$want\" ]; then if [ \"$v\" = \"2.4.0\" ]; then printf \"%s\\n\" \"::error::jactionlint_executable_not_catalogued: jactionlint $v on $p has no executable digest in this Velnor catalog\" >&2; exit 1; fi; printf \"%s\\n\" \"::notice::jactionlint $v on $p has no Velnor executable digest; the Mise release digest and GitHub attestation checks still applied\"; exit 0; fi; d=\"$RUNNER_TEMP/velnor/jactionlint-verify\"; rm -rf \"$d\"; mkdir -p \"$d\"; velnor_capture_physical_path() {\n [ \"$#\" -eq 2 ] || return 1\n (cd -P \"$1\" && pwd -P) > \"$2\" || return 1\n resolved_path=\n newline='\\''\n'\\''\n while IFS= read -r path_line; do\n resolved_path=$resolved_path$path_line\"$newline\"\n done < \"$2\"\n case \"$resolved_path\" in\n *\"$newline\") resolved_path=${resolved_path%\"$newline\"} ;;\n *) return 1 ;;\n esac\n printf '\\''%s\\n'\\'' \"$resolved_path\" > \"$2\" || return 1\n}; velnor_bind_selected_mise() { [ \"$#\" -eq 1 ] || return 5; mise_data_dir=${MISE_DATA_DIR-}; if [ -z \"$mise_data_dir\" ]; then if [ -n \"${XDG_DATA_HOME-}\" ]; then mise_data_dir=\"$XDG_DATA_HOME/mise\"; elif [ -n \"${HOME-}\" ]; then mise_data_dir=\"$HOME/.local/share/mise\"; else return 1; fi; fi; case \"$mise_data_dir\" in /*) ;; *) mise_data_dir=./$mise_data_dir;; esac; case \"$mise_data_dir\" in /) ;; */) mise_data_dir=${mise_data_dir%/};; esac; [ -d \"$mise_data_dir\" ] || return 2; velnor_capture_physical_path \"$mise_data_dir\" \"$1\" || return 3; resolved_mise_data_dir=$resolved_path; [ -d \"$resolved_mise_data_dir/bin\" ] || return 4; velnor_capture_physical_path \"$resolved_mise_data_dir/bin\" \"$1\" || return 4; resolved_mise_bin_dir=$resolved_path; mise_bin=\"$resolved_mise_bin_dir/mise\"; [ -f \"$mise_bin\" ] && [ -x \"$mise_bin\" ] && [ ! -L \"$mise_bin\" ] || return 4; MISE_DATA_DIR=\"$resolved_mise_data_dir\"; export MISE_DATA_DIR; return 0; }; if velnor_bind_selected_mise \"$d/mise-data-dir\"; then :; else bind_status=$?; case \"$bind_status\" in 1) printf \"%s\\n\" \"::error::jactionlint_mise_data_dir_missing: no Setup Mise data directory is selected\" >&2;; 2) printf \"%s\\n\" \"::error::jactionlint_mise_data_dir_invalid: Setup Mise data directory is missing\" >&2;; 3) printf \"%s\\n\" \"::error::jactionlint_mise_data_dir_unresolvable: Setup Mise data directory cannot be resolved\" >&2;; *) printf \"%s\\n\" \"::error::jactionlint_mise_binary_invalid: Setup Mise binary is missing, not executable, or a symlink\" >&2;; esac; exit 1; fi; MISE_DATA_DIR=\"$resolved_mise_data_dir\" \"$mise_bin\" --no-config --no-env --no-hooks which --tool \"jactionlint@$v\" jactionlint > \"$d/path\" || { printf \"%s\\n\" \"::error::jactionlint_not_installed: jactionlint@$v\" >&2; exit 1; }; IFS= read -r exe < \"$d/path\"; test -f \"$exe\" || { printf \"%s\\n\" \"::error::jactionlint_executable_missing: $exe\" >&2; exit 1; }; printf \"%s %s\\n\" \"$want\" \"$exe\" > \"$d/executable.sha256\"; if command -v sha256sum >/dev/null 2>&1; then sha256sum -c \"$d/executable.sha256\" >/dev/null; else shasum -a 256 -c \"$d/executable.sha256\" >/dev/null; fi || { printf \"%s\\n\" \"::error::jactionlint_executable_digest_mismatch: $exe is not SHA-256 $want\" >&2; exit 1; }; printf \"%s\\n\" \"velnor: jactionlint $v ($p) executable SHA-256 $want verified\"'" diff --git a/.github/actions/velnor-verify-restored-rust/action.yml b/.github/actions/velnor-verify-restored-rust/action.yml new file mode 100644 index 0000000..ff8647f --- /dev/null +++ b/.github/actions/velnor-verify-restored-rust/action.yml @@ -0,0 +1,24 @@ +# Generated by Velnor Actions 0.1.80; edit .velnor/config.toml and regenerate. +name: Velnor restored Rust verifier +description: Shared steps for Velnor restored Rust verifier +runs: + using: composite + steps: + - name: Verify restored Rust toolchain + env: + ACTIONS_ID_TOKEN_REQUEST_TOKEN: "" + ACTIONS_ID_TOKEN_REQUEST_URL: "" + ACTIONS_RUNTIME_TOKEN: "" + CARGO_HOME: ${{ runner.temp }}/velnor/cargo + CARGO_REGISTRY_TOKEN: "" + GH_CONFIG_DIR: "" + GH_HOST: "" + GH_TOKEN: "" + GITHUB_TOKEN: "" + MISE_GITHUB_TOKEN: "" + NODE_AUTH_TOKEN: "" + NPM_TOKEN: "" + PATH: /usr/bin:/bin:/usr/sbin:/sbin + RUSTUP_HOME: ${{ runner.temp }}/velnor/rustup + shell: /bin/bash --noprofile --norc -p -e -o pipefail {0} + run: "function_env_unset=(); function_env_scan_complete=0; while IFS= read -r -d '' env_entry; do case \"$env_entry\" in BASH_FUNC_*=*) function_env_unset+=(-u \"${env_entry%%=*}\");; VELNOR_VERIFIER_ENV_SCAN_COMPLETE) function_env_scan_complete=$((function_env_scan_complete + 1));; esac; done < <({ /usr/bin/env -0 && printf '%s\\000' 'VELNOR_VERIFIER_ENV_SCAN_COMPLETE'; }); [ \"$function_env_scan_complete\" -eq 1 ] || exit 1; exec /usr/bin/env \"${function_env_unset[@]}\" -u BASH_ENV -u ENV -u ACTIONS_ID_TOKEN_REQUEST_TOKEN -u ACTIONS_ID_TOKEN_REQUEST_URL -u ACTIONS_RUNTIME_TOKEN -u GITHUB_TOKEN -u MISE_GITHUB_TOKEN -u GH_TOKEN -u GH_HOST -u GH_CONFIG_DIR PATH=/usr/bin:/bin:/usr/sbin:/sbin /bin/bash --noprofile --norc -p -e -o pipefail -c 'unset ACTIONS_ID_TOKEN_REQUEST_TOKEN ACTIONS_ID_TOKEN_REQUEST_URL ACTIONS_RUNTIME_TOKEN GITHUB_TOKEN MISE_GITHUB_TOKEN GH_TOKEN GH_HOST GH_CONFIG_DIR; set -eu; PATH=/usr/bin:/bin:/usr/sbin:/sbin; export PATH; ev() { /usr/bin/env -i LC_ALL=C ${PATH+PATH=\"$PATH\"} ${HOME+HOME=\"$HOME\"} ${RUNNER_TEMP+RUNNER_TEMP=\"$RUNNER_TEMP\"} ${RUSTUP_HOME+RUSTUP_HOME=\"$RUSTUP_HOME\"} ${MISE_RUSTUP_HOME+MISE_RUSTUP_HOME=\"$MISE_RUSTUP_HOME\"} ${CARGO_HOME+CARGO_HOME=\"$CARGO_HOME\"} ${VELNOR_TOOL_RUST+VELNOR_TOOL_RUST=\"$VELNOR_TOOL_RUST\"} ${HTTPS_PROXY+HTTPS_PROXY=\"$HTTPS_PROXY\"} ${https_proxy+https_proxy=\"$https_proxy\"} ${HTTP_PROXY+HTTP_PROXY=\"$HTTP_PROXY\"} ${http_proxy+http_proxy=\"$http_proxy\"} ${NO_PROXY+NO_PROXY=\"$NO_PROXY\"} ${no_proxy+no_proxy=\"$no_proxy\"} ${ALL_PROXY+ALL_PROXY=\"$ALL_PROXY\"} ${all_proxy+all_proxy=\"$all_proxy\"} ${SSL_CERT_FILE+SSL_CERT_FILE=\"$SSL_CERT_FILE\"} ${SSL_CERT_DIR+SSL_CERT_DIR=\"$SSL_CERT_DIR\"} ${CURL_CA_BUNDLE+CURL_CA_BUNDLE=\"$CURL_CA_BUNDLE\"} \"$@\"; }; v=\"1.99.1\"; fail() { printf \"%s\\n\" \"::error::$1\" >&2; exit 1; }; case \"$v\" in 1.85.0) want=009e8b5ff43f12bf644b5e5b9fd89f96453072062a450c623882f64e85405da5;; 1.85.1) want=1e7dae690cd12e27405a97e64704917489a27c650201bf47780a936055d67909;; 1.86.0) want=5ffe190473b7896d1f39e9d0ddfa04bec72000f25897669bb296814e10ceba42;; 1.87.0) want=2949b5ea91e3f9c45e75ff2fc6cfc7776616c693ab599ed43abc2120b7522415;; 1.88.0) want=431b7c5c0b9a511d8e31d29b378bbc74124e8521f14beb92d3a5a5f7e7e55449;; 1.89.0) want=fbd1662e100e7b305908ece23b441cb7534eadfa6336c5f173ff08d1cec174a1;; 1.90.0) want=489c19f20d331765ab2835661eb546de90f6446a107a8db83045e7371e45cae2;; 1.91.0) want=d9e59cdf15532aa839c0a4871b0b755e833f914042eb2dcc59f2a0ef8667f9f6;; 1.91.1) want=483bb8b271168ee654e3be4f111beefa23b9d0c8b7f4a563a8278978dbe982e5;; 1.92.0) want=b2a49624353173ecdacf59c158c00929300606e1963f6e4609fb483a508402d0;; 1.93.0) want=beb6ba4e41c84e9c11c80e6804a007497d0c8ba0810cd403fabc8f4a9c45b1f8;; 1.93.1) want=4812a3c610bacc74eed12c89c312e540722dccccd867bd55096402da13b3a516;; 1.94.0) want=aaa177def36e01d539bee6bde95295230b9ce378f81057845db8d0ebe97898ee;; 1.94.1) want=cc2f04dfc883549d683c8cc2a9393f523a3dfbd931f5d5eaef00303cca64a60d;; 1.95.0) want=821ff14e4c4a1cbe1e8915f35aff0a3fbbdf8d293ad48ab8f31e3b0440c581f9;; 1.96.0) want=9af50610e1d82699f78a40b985c9277ae1a2c5a0bec86ae430cfe58832038285;; 1.96.1) want=87eb76c53073e72b766083bed5530820694253b832a762d8385bda5759f03975;; 1.97.0) want=3804d2666f7c12ce64205baa69b6be52f910b45b158091013264beb7aa1de7f5;; 1.97.1) want=03569b1886ceb5c05276b50c8431ab111de944cd6140fe1fa7d821dd8e0f29cf;; 1.98.0) want=3f7d139b73bbbd0004ef6e58b430831c68cdad2b1f64ee2eb35d54c09199489a;; 1.98.1) want=a7c8774a5fd8441c997d94c029776cbc5eb111e9d72ab5d256fa69866644347e;; 1.99.0) want=ce6dddc886364f8d786514771212cebe9b731ba82d6b859951c6b0ccc516b6a2;; 1.99.1) want=fb152be80975c194aa5fc684b2aec3a6e14e2b855efe2faa4e5f8ae6e590f463;; *) fail \"rust_channel_manifest_not_catalogued: Rust $v has no channel-manifest digest in this Velnor catalog; upgrade velnor-actions or pin a catalogued Rust\";; esac; rh=\"${RUSTUP_HOME:-${MISE_RUSTUP_HOME:-$HOME/.rustup}}\"; r=\"$RUNNER_TEMP/velnor/rust-verified\"; d=\"$RUNNER_TEMP/velnor/rust-manifest\"; ev rm -rf \"$d\"; ev rm -rf \"$r\"; ev mkdir -p \"$d\" \"$r\"; ev rm -rf \"${CARGO_HOME:?}/bin\"; real() { if [ -e \"$1\" ] || [ -L \"$1\" ]; then { [ -d \"$1\" ] && [ ! -L \"$1\" ]; } || fail \"rust_toolchain_path_unexpected: $1 is not a real directory\"; fi; }; real \"$rh/toolchains\"; pm() { printf \"%s\\n\" \"::notice::pin_mismatch: $1\"; }; pinned=0; case \"$v\" in 1.99.1) pinned=1;; esac; [ \"$pinned\" = 0 ] || { set --; for e in \"$rh/toolchains\"/* \"$rh/toolchains\"/.[!.]* \"$rh/toolchains\"/..?*; do if [ -e \"$e\" ] || [ -L \"$e\" ]; then set -- \"$@\" \"$e\"; fi; done; if [ \"$#\" -eq 1 ] && case \"$1\" in \"$rh/toolchains/$v-x86_64-unknown-linux-gnu\") false;; \"$rh/toolchains/$v-\"*-*-*) true;; *) false;; esac; then pinned=0; else [ \"$#\" -eq 0 ] || { [ \"$#\" -eq 1 ] && [ \"$1\" = \"$rh/toolchains/$v-x86_64-unknown-linux-gnu\" ]; } || { pm toolchains_differ; fail \"rust_tree_digest_mismatch: $rh/toolchains holds an entry other than the pinned Rust $v-x86_64-unknown-linux-gnu toolchain; the pin_mismatch notice above names the check that failed\"; }; fi; }; set -- \"$rh/toolchains/$v\"-*; if [ \"$#\" -eq 1 ] && [ ! -e \"$1\" ] && [ ! -L \"$1\" ]; then printf \"%s\\n\" \"velnor: no restored Rust $v toolchain; the install verifies the fresh one\"; exit 0; fi; { [ \"$#\" -eq 1 ] && [ -d \"$1\" ] && [ ! -L \"$1\" ]; } || fail \"rust_toolchain_missing: $rh/toolchains holds no single real Rust $v toolchain directory\"; t=\"$1\"; real \"$t/lib\"; real \"$t/lib/rustlib\"; m=\"$t/lib/rustlib/multirust-channel-manifest.toml\"; if command -v sha256sum >/dev/null 2>&1; then hb=\"sha256sum\"; else hb=\"shasum -a 256\"; fi; h=\"ev $hb\"; test -f \"$t/lib/rustlib/components\" || fail \"rust_installed_manifest_missing: $t/lib/rustlib/components\"; ev find \"$t\" ! -type f ! -type d > \"$d/special\"; test ! -s \"$d/special\" || fail \"rust_toolchain_file_unexpected: $t holds a symlink or a special file\"; get() { ev curl -q --proto \"=https\" --proto-redir \"=https\" --tlsv1.2 --fail --silent --show-error --location --retry 3 --retry-all-errors --connect-timeout 20 --max-time 120 --retry-max-time 180 --output \"$1\" \"$2\"; }; put() { [ ! -d \"$2\" ] && ev rm -f \"$2.new\" && ev cp \"$1\" \"$2.new\" && ev chmod 0644 \"$2.new\" && ev mv -f \"$2.new\" \"$2\" || { ev rm -f \"$2.new\"; return 1; }; }; channel_ok() { printf \"%s %s\\n\" \"$want\" \"$d/channel.toml\" > \"$d/channel.sha256\"; $h -c \"$d/channel.sha256\" >/dev/null 2>&1; }; verified_channel() { s=\"$r/channel-rust-$v.toml\"; if [ -f \"$s\" ] && [ ! -L \"$s\" ] && ev cp \"$s\" \"$d/channel.toml\" && channel_ok; then return 0; fi; get \"$d/channel.toml\" \"https://static.rust-lang.org/dist/channel-rust-$v.toml\"; channel_ok || fail \"rust_channel_manifest_digest_mismatch: channel-rust-$v.toml is not SHA-256 $want\"; put \"$d/channel.toml\" \"$s\" || :; }; install_manifest() { [ ! -d \"$m\" ] || fail \"rust_toolchain_file_unexpected: $m is a directory\"; verified_channel; put \"$d/channel.toml\" \"$m\" || fail \"rust_installed_manifest_unwritable: $m\"; }; pin_check() ( ev sort \"$t/lib/rustlib/components\" | $h > \"$d/pin.cs\"; read -r cs rest < \"$d/pin.cs\" || cs=unreadable; [ \"$pinned\" = 1 ] || { pm \"no_pin components=$cs\"; return 1; }; pin=\"\"; case \"$v:$cs\" in 1.99.1:e3808a4c78c316b41a42ed88010c6bbf24ae24a348a5a22b8e3bc62328db1981) pin=f9eeeb78948257bc3c861d018ecf4d22f16e38fbc8ba4a97c1126a1a1c45bb25;; 1.99.1:a13769c18a7a74ea492ab633b644d6c238ae81e536d30d3f168eddb57e86000e) pin=56452430d3faa33fd43083ef5dc0d3fb5da905f35515e6f174e46ecd3a607dea;; *) ;; esac; [ -n \"$pin\" ] || { pm \"components_not_pinned components=$cs\"; return 2; }; (cd \"$t\" && ev find . -name \"*[!A-Za-z0-9._+-]*\") > \"$d/pin.unsafe\" || { pm tree_unreadable; return 2; }; [ ! -s \"$d/pin.unsafe\" ] || { pm unsafe_name; return 2; }; (cd \"$t\" && ev find . -type f -exec $hb {} +) > \"$d/pin.sums\" || { pm tree_unreadable; return 2; }; (cd \"$t\" && ev find . -printf \"%y %#m %s %p\\n\") > \"$d/pin.modes\" || { pm tree_unreadable; return 2; }; ev awk -v cs=\"$cs\" -v cap=4194304 '\\''NR == FNR { dg[$2] = $1; next } { k = $1; mode = $2; p = $4; if (k != \"f\" && k != \"d\") exit 2; r = (p == \".\") ? \".\" : substr(p, 3); if (k == \"d\") { print \"d\", mode, \"-\", r; next } if (r == \"lib/rustlib/multirust-config.toml\") { if ($3 + 0 > cap + 0) exit 3; print \"b\", mode, \"-\", r; next } if (r == \"lib/rustlib/components\") { print \"f\", mode, cs, r; next } if (!(p in dg)) exit 4; print \"f\", mode, dg[p], r }'\\'' \"$d/pin.sums\" \"$d/pin.modes\" > \"$d/pin.list\" || { pm listing_failed; return 2; }; ev sort -k4,4 \"$d/pin.list\" | ev tr \"\\n\" \"\\000\" | $h > \"$d/pin.got\"; read -r got rest < \"$d/pin.got\" || { pm tree_unreadable; return 2; }; [ \"$got\" = \"$pin\" ] || { pm tree_differs; return 2; } ); rc=0; pin_check || rc=$?; case \"$rc\" in 0) put \"$m\" \"$r/channel-rust-$v.toml\" || :; printf \"%s\\n\" \"velnor: Rust $v toolchain matches pinned tree digest\"; exit 0;; 1) ;; *) fail \"rust_tree_digest_mismatch: $t differs from the pinned tree digest of Rust $v; the pin_mismatch notice above names the check that failed\" ;; esac; install_manifest; ev awk -v comps=\"$t/lib/rustlib/components\" '\\''BEGIN { while ((getline line < comps) > 0) if (line != \"\") want[line] = 1 } /^\\[/ { key = \"\"; if ($0 ~ /^\\[pkg\\.[^]]*\\.target\\.[^]]*\\]$/) { s = substr($0, 6, length($0) - 6); p = index(s, \".target.\"); k = substr(s, 1, p - 1) \"-\" substr(s, p + 8); if (k in want) key = k } next } key != \"\" && $1 == \"xz_url\" { u = $3; gsub(/\"/, \"\", u); url[key] = u } key != \"\" && $1 == \"xz_hash\" { h = $3; gsub(/\"/, \"\", h); hash[key] = h } END { for (k in want) { if (!(k in url) || !(k in hash)) exit 1; print k, url[k], hash[k] } }'\\'' \"$d/channel.toml\" > \"$d/tarballs\" || fail \"rust_component_not_in_manifest: $t lists a component the verified channel-rust-$v.toml does not ship\"; test -s \"$d/tarballs\" || fail \"rust_installed_manifest_empty: $t lists no component\"; : > \"$d/expected\"; while read -r comp url hash; do case \"$comp\" in *[!A-Za-z0-9._-]*|\"\") fail \"rust_component_name_invalid: $comp\";; esac; case \"$url\" in https://static.rust-lang.org/dist/*.tar.xz) ;; *) fail \"rust_component_url_untrusted: $url\";; esac; if [ ! -f \"$r/$comp.$hash\" ]; then get \"$d/c.tar.xz\" \"$url\"; printf \"%s %s\\n\" \"$hash\" \"$d/c.tar.xz\" > \"$d/c.sha256\"; $h -c \"$d/c.sha256\" >/dev/null || fail \"rust_component_tarball_digest_mismatch: $comp\"; ev rm -rf \"$d/x\"; ev mkdir \"$d/x\"; ev tar -xJf \"$d/c.tar.xz\" -C \"$d/x\" --strip-components=1; ev rm -f \"$d/c.tar.xz\"; : > \"$d/c.sums\"; while read -r sub; do case \"$sub\" in *[!A-Za-z0-9._-]*|\"\"|.|..) fail \"rust_component_name_invalid: $sub\";; esac; (cd \"$d/x/$sub\" && ev find . -type f ! -path ./manifest.in -exec $hb {} +) >> \"$d/c.sums\"; done < \"$d/x/components\"; ev mv \"$d/c.sums\" \"$r/$comp.$hash\"; fi; ev cat \"$r/$comp.$hash\" >> \"$d/expected\"; done < \"$d/tarballs\"; (cd \"$t\" && ev find . -type f ! -path ./lib/rustlib/components ! \\( -path \"./lib/rustlib/manifest-*\" ! -path \"./lib/rustlib/manifest-*/*\" \\) ! -path ./lib/rustlib/multirust-channel-manifest.toml ! -path ./lib/rustlib/multirust-config.toml ! -path ./lib/rustlib/rust-installer-version -exec $hb {} +) > \"$d/installed\"; ev sort -k2 \"$d/expected\" > \"$d/expected.sorted\"; ev sort -k2 \"$d/installed\" > \"$d/installed.sorted\"; if ! ev cmp -s \"$d/expected.sorted\" \"$d/installed.sorted\"; then ev diff \"$d/expected.sorted\" \"$d/installed.sorted\" | ev head -n 20 >&2 || true; fail \"rust_toolchain_bytes_mismatch: $t differs from the component tarballs of the verified channel-rust-$v.toml\"; fi; printf \"%s\\n\" \"velnor: Rust $v toolchain verified file by file against the component tarballs of channel-rust-$v.toml (SHA-256 $want)\"'" diff --git a/.github/actions/velnor-verify-rust-manifest/action.yml b/.github/actions/velnor-verify-rust-manifest/action.yml new file mode 100644 index 0000000..8b652c9 --- /dev/null +++ b/.github/actions/velnor-verify-rust-manifest/action.yml @@ -0,0 +1,24 @@ +# Generated by Velnor Actions 0.1.80; edit .velnor/config.toml and regenerate. +name: Velnor Rust channel verifier +description: Shared steps for Velnor Rust channel verifier +runs: + using: composite + steps: + - name: Verify Rust channel manifest + env: + ACTIONS_ID_TOKEN_REQUEST_TOKEN: "" + ACTIONS_ID_TOKEN_REQUEST_URL: "" + ACTIONS_RUNTIME_TOKEN: "" + CARGO_HOME: ${{ runner.temp }}/velnor/cargo + CARGO_REGISTRY_TOKEN: "" + GH_CONFIG_DIR: "" + GH_HOST: "" + GH_TOKEN: "" + GITHUB_TOKEN: "" + MISE_GITHUB_TOKEN: "" + NODE_AUTH_TOKEN: "" + NPM_TOKEN: "" + PATH: /usr/bin:/bin:/usr/sbin:/sbin + RUSTUP_HOME: ${{ runner.temp }}/velnor/rustup + shell: /bin/bash --noprofile --norc -p -e -o pipefail {0} + run: "function_env_unset=(); function_env_scan_complete=0; while IFS= read -r -d '' env_entry; do case \"$env_entry\" in BASH_FUNC_*=*) function_env_unset+=(-u \"${env_entry%%=*}\");; VELNOR_VERIFIER_ENV_SCAN_COMPLETE) function_env_scan_complete=$((function_env_scan_complete + 1));; esac; done < <({ /usr/bin/env -0 && printf '%s\\000' 'VELNOR_VERIFIER_ENV_SCAN_COMPLETE'; }); [ \"$function_env_scan_complete\" -eq 1 ] || exit 1; exec /usr/bin/env \"${function_env_unset[@]}\" -u BASH_ENV -u ENV -u ACTIONS_ID_TOKEN_REQUEST_TOKEN -u ACTIONS_ID_TOKEN_REQUEST_URL -u ACTIONS_RUNTIME_TOKEN -u GITHUB_TOKEN -u MISE_GITHUB_TOKEN -u GH_TOKEN -u GH_HOST -u GH_CONFIG_DIR PATH=/usr/bin:/bin:/usr/sbin:/sbin /bin/bash --noprofile --norc -p -e -o pipefail -c 'unset ACTIONS_ID_TOKEN_REQUEST_TOKEN ACTIONS_ID_TOKEN_REQUEST_URL ACTIONS_RUNTIME_TOKEN GITHUB_TOKEN MISE_GITHUB_TOKEN GH_TOKEN GH_HOST GH_CONFIG_DIR; set -eu; PATH=/usr/bin:/bin:/usr/sbin:/sbin; export PATH; ev() { /usr/bin/env -i LC_ALL=C ${PATH+PATH=\"$PATH\"} ${HOME+HOME=\"$HOME\"} ${RUNNER_TEMP+RUNNER_TEMP=\"$RUNNER_TEMP\"} ${RUSTUP_HOME+RUSTUP_HOME=\"$RUSTUP_HOME\"} ${MISE_RUSTUP_HOME+MISE_RUSTUP_HOME=\"$MISE_RUSTUP_HOME\"} ${CARGO_HOME+CARGO_HOME=\"$CARGO_HOME\"} ${VELNOR_TOOL_RUST+VELNOR_TOOL_RUST=\"$VELNOR_TOOL_RUST\"} ${HTTPS_PROXY+HTTPS_PROXY=\"$HTTPS_PROXY\"} ${https_proxy+https_proxy=\"$https_proxy\"} ${HTTP_PROXY+HTTP_PROXY=\"$HTTP_PROXY\"} ${http_proxy+http_proxy=\"$http_proxy\"} ${NO_PROXY+NO_PROXY=\"$NO_PROXY\"} ${no_proxy+no_proxy=\"$no_proxy\"} ${ALL_PROXY+ALL_PROXY=\"$ALL_PROXY\"} ${all_proxy+all_proxy=\"$all_proxy\"} ${SSL_CERT_FILE+SSL_CERT_FILE=\"$SSL_CERT_FILE\"} ${SSL_CERT_DIR+SSL_CERT_DIR=\"$SSL_CERT_DIR\"} ${CURL_CA_BUNDLE+CURL_CA_BUNDLE=\"$CURL_CA_BUNDLE\"} \"$@\"; }; v=\"1.99.1\"; fail() { printf \"%s\\n\" \"::error::$1\" >&2; exit 1; }; case \"$v\" in 1.85.0) want=009e8b5ff43f12bf644b5e5b9fd89f96453072062a450c623882f64e85405da5;; 1.85.1) want=1e7dae690cd12e27405a97e64704917489a27c650201bf47780a936055d67909;; 1.86.0) want=5ffe190473b7896d1f39e9d0ddfa04bec72000f25897669bb296814e10ceba42;; 1.87.0) want=2949b5ea91e3f9c45e75ff2fc6cfc7776616c693ab599ed43abc2120b7522415;; 1.88.0) want=431b7c5c0b9a511d8e31d29b378bbc74124e8521f14beb92d3a5a5f7e7e55449;; 1.89.0) want=fbd1662e100e7b305908ece23b441cb7534eadfa6336c5f173ff08d1cec174a1;; 1.90.0) want=489c19f20d331765ab2835661eb546de90f6446a107a8db83045e7371e45cae2;; 1.91.0) want=d9e59cdf15532aa839c0a4871b0b755e833f914042eb2dcc59f2a0ef8667f9f6;; 1.91.1) want=483bb8b271168ee654e3be4f111beefa23b9d0c8b7f4a563a8278978dbe982e5;; 1.92.0) want=b2a49624353173ecdacf59c158c00929300606e1963f6e4609fb483a508402d0;; 1.93.0) want=beb6ba4e41c84e9c11c80e6804a007497d0c8ba0810cd403fabc8f4a9c45b1f8;; 1.93.1) want=4812a3c610bacc74eed12c89c312e540722dccccd867bd55096402da13b3a516;; 1.94.0) want=aaa177def36e01d539bee6bde95295230b9ce378f81057845db8d0ebe97898ee;; 1.94.1) want=cc2f04dfc883549d683c8cc2a9393f523a3dfbd931f5d5eaef00303cca64a60d;; 1.95.0) want=821ff14e4c4a1cbe1e8915f35aff0a3fbbdf8d293ad48ab8f31e3b0440c581f9;; 1.96.0) want=9af50610e1d82699f78a40b985c9277ae1a2c5a0bec86ae430cfe58832038285;; 1.96.1) want=87eb76c53073e72b766083bed5530820694253b832a762d8385bda5759f03975;; 1.97.0) want=3804d2666f7c12ce64205baa69b6be52f910b45b158091013264beb7aa1de7f5;; 1.97.1) want=03569b1886ceb5c05276b50c8431ab111de944cd6140fe1fa7d821dd8e0f29cf;; 1.98.0) want=3f7d139b73bbbd0004ef6e58b430831c68cdad2b1f64ee2eb35d54c09199489a;; 1.98.1) want=a7c8774a5fd8441c997d94c029776cbc5eb111e9d72ab5d256fa69866644347e;; 1.99.0) want=ce6dddc886364f8d786514771212cebe9b731ba82d6b859951c6b0ccc516b6a2;; 1.99.1) want=fb152be80975c194aa5fc684b2aec3a6e14e2b855efe2faa4e5f8ae6e590f463;; *) fail \"rust_channel_manifest_not_catalogued: Rust $v has no channel-manifest digest in this Velnor catalog; upgrade velnor-actions or pin a catalogued Rust\";; esac; rh=\"${RUSTUP_HOME:-${MISE_RUSTUP_HOME:-$HOME/.rustup}}\"; r=\"$RUNNER_TEMP/velnor/rust-verified\"; d=\"$RUNNER_TEMP/velnor/rust-manifest\"; ev rm -rf \"$d\"; ev mkdir -p \"$d\" \"$r\"; real() { if [ -e \"$1\" ] || [ -L \"$1\" ]; then { [ -d \"$1\" ] && [ ! -L \"$1\" ]; } || fail \"rust_toolchain_path_unexpected: $1 is not a real directory\"; fi; }; real \"$rh/toolchains\"; pm() { printf \"%s\\n\" \"::notice::pin_mismatch: $1\"; }; pinned=0; case \"$v\" in 1.99.1) pinned=1;; esac; [ \"$pinned\" = 0 ] || { set --; for e in \"$rh/toolchains\"/* \"$rh/toolchains\"/.[!.]* \"$rh/toolchains\"/..?*; do if [ -e \"$e\" ] || [ -L \"$e\" ]; then set -- \"$@\" \"$e\"; fi; done; if [ \"$#\" -eq 1 ] && case \"$1\" in \"$rh/toolchains/$v-x86_64-unknown-linux-gnu\") false;; \"$rh/toolchains/$v-\"*-*-*) true;; *) false;; esac; then pinned=0; else [ \"$#\" -eq 0 ] || { [ \"$#\" -eq 1 ] && [ \"$1\" = \"$rh/toolchains/$v-x86_64-unknown-linux-gnu\" ]; } || { pm toolchains_differ; fail \"rust_tree_digest_mismatch: $rh/toolchains holds an entry other than the pinned Rust $v-x86_64-unknown-linux-gnu toolchain; the pin_mismatch notice above names the check that failed\"; }; fi; }; set -- \"$rh/toolchains/$v\"-*; { [ \"$#\" -eq 1 ] && [ -d \"$1\" ] && [ ! -L \"$1\" ]; } || fail \"rust_toolchain_missing: $rh/toolchains holds no single real Rust $v toolchain directory\"; t=\"$1\"; real \"$t/lib\"; real \"$t/lib/rustlib\"; m=\"$t/lib/rustlib/multirust-channel-manifest.toml\"; if command -v sha256sum >/dev/null 2>&1; then hb=\"sha256sum\"; else hb=\"shasum -a 256\"; fi; h=\"ev $hb\"; test -f \"$t/lib/rustlib/components\" || fail \"rust_installed_manifest_missing: $t/lib/rustlib/components\"; ev find \"$t\" ! -type f ! -type d > \"$d/special\"; test ! -s \"$d/special\" || fail \"rust_toolchain_file_unexpected: $t holds a symlink or a special file\"; get() { ev curl -q --proto \"=https\" --proto-redir \"=https\" --tlsv1.2 --fail --silent --show-error --location --retry 3 --retry-all-errors --connect-timeout 20 --max-time 120 --retry-max-time 180 --output \"$1\" \"$2\"; }; put() { [ ! -d \"$2\" ] && ev rm -f \"$2.new\" && ev cp \"$1\" \"$2.new\" && ev chmod 0644 \"$2.new\" && ev mv -f \"$2.new\" \"$2\" || { ev rm -f \"$2.new\"; return 1; }; }; channel_ok() { printf \"%s %s\\n\" \"$want\" \"$d/channel.toml\" > \"$d/channel.sha256\"; $h -c \"$d/channel.sha256\" >/dev/null 2>&1; }; verified_channel() { s=\"$r/channel-rust-$v.toml\"; if [ -f \"$s\" ] && [ ! -L \"$s\" ] && ev cp \"$s\" \"$d/channel.toml\" && channel_ok; then return 0; fi; get \"$d/channel.toml\" \"https://static.rust-lang.org/dist/channel-rust-$v.toml\"; channel_ok || fail \"rust_channel_manifest_digest_mismatch: channel-rust-$v.toml is not SHA-256 $want\"; put \"$d/channel.toml\" \"$s\" || :; }; install_manifest() { [ ! -d \"$m\" ] || fail \"rust_toolchain_file_unexpected: $m is a directory\"; verified_channel; put \"$d/channel.toml\" \"$m\" || fail \"rust_installed_manifest_unwritable: $m\"; }; install_manifest; pin_check() ( ev sort \"$t/lib/rustlib/components\" | $h > \"$d/pin.cs\"; read -r cs rest < \"$d/pin.cs\" || cs=unreadable; [ \"$pinned\" = 1 ] || { pm \"no_pin components=$cs\"; return 1; }; pin=\"\"; case \"$v:$cs\" in 1.99.1:e3808a4c78c316b41a42ed88010c6bbf24ae24a348a5a22b8e3bc62328db1981) pin=f9eeeb78948257bc3c861d018ecf4d22f16e38fbc8ba4a97c1126a1a1c45bb25;; 1.99.1:a13769c18a7a74ea492ab633b644d6c238ae81e536d30d3f168eddb57e86000e) pin=56452430d3faa33fd43083ef5dc0d3fb5da905f35515e6f174e46ecd3a607dea;; *) ;; esac; [ -n \"$pin\" ] || { pm \"components_not_pinned components=$cs\"; return 2; }; (cd \"$t\" && ev find . -name \"*[!A-Za-z0-9._+-]*\") > \"$d/pin.unsafe\" || { pm tree_unreadable; return 2; }; [ ! -s \"$d/pin.unsafe\" ] || { pm unsafe_name; return 2; }; (cd \"$t\" && ev find . -type f -exec $hb {} +) > \"$d/pin.sums\" || { pm tree_unreadable; return 2; }; (cd \"$t\" && ev find . -printf \"%y %#m %s %p\\n\") > \"$d/pin.modes\" || { pm tree_unreadable; return 2; }; ev awk -v cs=\"$cs\" -v cap=4194304 '\\''NR == FNR { dg[$2] = $1; next } { k = $1; mode = $2; p = $4; if (k != \"f\" && k != \"d\") exit 2; r = (p == \".\") ? \".\" : substr(p, 3); if (k == \"d\") { print \"d\", mode, \"-\", r; next } if (r == \"lib/rustlib/multirust-config.toml\") { if ($3 + 0 > cap + 0) exit 3; print \"b\", mode, \"-\", r; next } if (r == \"lib/rustlib/components\") { print \"f\", mode, cs, r; next } if (!(p in dg)) exit 4; print \"f\", mode, dg[p], r }'\\'' \"$d/pin.sums\" \"$d/pin.modes\" > \"$d/pin.list\" || { pm listing_failed; return 2; }; ev sort -k4,4 \"$d/pin.list\" | ev tr \"\\n\" \"\\000\" | $h > \"$d/pin.got\"; read -r got rest < \"$d/pin.got\" || { pm tree_unreadable; return 2; }; [ \"$got\" = \"$pin\" ] || { pm tree_differs; return 2; } ); rc=0; pin_check || rc=$?; case \"$rc\" in 0) printf \"%s\\n\" \"velnor: Rust $v toolchain matches pinned tree digest\"; exit 0;; 1) ;; *) fail \"rust_tree_digest_mismatch: $t differs from the pinned tree digest of Rust $v; the pin_mismatch notice above names the check that failed\" ;; esac; ev awk -v comps=\"$t/lib/rustlib/components\" '\\''BEGIN { while ((getline line < comps) > 0) if (line != \"\") want[line] = 1 } /^\\[/ { key = \"\"; if ($0 ~ /^\\[pkg\\.[^]]*\\.target\\.[^]]*\\]$/) { s = substr($0, 6, length($0) - 6); p = index(s, \".target.\"); k = substr(s, 1, p - 1) \"-\" substr(s, p + 8); if (k in want) key = k } next } key != \"\" && $1 == \"xz_url\" { u = $3; gsub(/\"/, \"\", u); url[key] = u } key != \"\" && $1 == \"xz_hash\" { h = $3; gsub(/\"/, \"\", h); hash[key] = h } END { for (k in want) { if (!(k in url) || !(k in hash)) exit 1; print k, url[k], hash[k] } }'\\'' \"$d/channel.toml\" > \"$d/tarballs\" || fail \"rust_component_not_in_manifest: $t lists a component the verified channel-rust-$v.toml does not ship\"; test -s \"$d/tarballs\" || fail \"rust_installed_manifest_empty: $t lists no component\"; : > \"$d/expected\"; while read -r comp url hash; do case \"$comp\" in *[!A-Za-z0-9._-]*|\"\") fail \"rust_component_name_invalid: $comp\";; esac; case \"$url\" in https://static.rust-lang.org/dist/*.tar.xz) ;; *) fail \"rust_component_url_untrusted: $url\";; esac; if [ ! -f \"$r/$comp.$hash\" ]; then get \"$d/c.tar.xz\" \"$url\"; printf \"%s %s\\n\" \"$hash\" \"$d/c.tar.xz\" > \"$d/c.sha256\"; $h -c \"$d/c.sha256\" >/dev/null || fail \"rust_component_tarball_digest_mismatch: $comp\"; ev rm -rf \"$d/x\"; ev mkdir \"$d/x\"; ev tar -xJf \"$d/c.tar.xz\" -C \"$d/x\" --strip-components=1; ev rm -f \"$d/c.tar.xz\"; : > \"$d/c.sums\"; while read -r sub; do case \"$sub\" in *[!A-Za-z0-9._-]*|\"\"|.|..) fail \"rust_component_name_invalid: $sub\";; esac; (cd \"$d/x/$sub\" && ev find . -type f ! -path ./manifest.in -exec $hb {} +) >> \"$d/c.sums\"; done < \"$d/x/components\"; ev mv \"$d/c.sums\" \"$r/$comp.$hash\"; fi; ev cat \"$r/$comp.$hash\" >> \"$d/expected\"; done < \"$d/tarballs\"; (cd \"$t\" && ev find . -type f ! -path ./lib/rustlib/components ! \\( -path \"./lib/rustlib/manifest-*\" ! -path \"./lib/rustlib/manifest-*/*\" \\) ! -path ./lib/rustlib/multirust-channel-manifest.toml ! -path ./lib/rustlib/multirust-config.toml ! -path ./lib/rustlib/rust-installer-version -exec $hb {} +) > \"$d/installed\"; ev sort -k2 \"$d/expected\" > \"$d/expected.sorted\"; ev sort -k2 \"$d/installed\" > \"$d/installed.sorted\"; if ! ev cmp -s \"$d/expected.sorted\" \"$d/installed.sorted\"; then ev diff \"$d/expected.sorted\" \"$d/installed.sorted\" | ev head -n 20 >&2 || true; fail \"rust_toolchain_bytes_mismatch: $t differs from the component tarballs of the verified channel-rust-$v.toml\"; fi; printf \"%s\\n\" \"velnor: Rust $v toolchain verified file by file against the component tarballs of channel-rust-$v.toml (SHA-256 $want)\"'" diff --git a/.github/jactionlint.yaml b/.github/jactionlint.yaml new file mode 100644 index 0000000..df26b71 --- /dev/null +++ b/.github/jactionlint.yaml @@ -0,0 +1,5 @@ +# Generated by Velnor Actions 0.1.80; edit .velnor/config.toml and regenerate. + +profile: correctness +generated-files: report +config-variables: [] diff --git a/.github/scripts/velnor-tools-cache-identity.sh b/.github/scripts/velnor-tools-cache-identity.sh new file mode 100644 index 0000000..511f00f --- /dev/null +++ b/.github/scripts/velnor-tools-cache-identity.sh @@ -0,0 +1,2 @@ +# Generated by Velnor Actions 0.1.80; edit .velnor/config.toml and regenerate. +export LC_ALL=C; set -eu; umask 077; : "${GITHUB_OUTPUT:?missing GITHUB_OUTPUT}"; scratch_root=; scratch_dir=; runner_os=${RUNNER_OS-}; runner_arch=${RUNNER_ARCH-}; image_os=${ImageOS-}; home=${HOME-}; runner_temp=${RUNNER_TEMP-}; mise_rustup=${MISE_RUSTUP_HOME-}; rustup_home=${RUSTUP_HOME-}; mise_cargo=${MISE_CARGO_HOME-}; cargo_home=${CARGO_HOME-}; valid_path() { value=$1; case "$value" in /*) ;; *) return 1 ;; esac; [ "$value" != / ] || return 1; case "$value" in *[![:print:]]*|*//*|*/./*|*/../*|*/.|*/..) return 1 ;; esac; remaining=${value#/}; prefix=; while [ -n "$remaining" ]; do case "$remaining" in */*) part=${remaining%%/*}; remaining=${remaining#*/} ;; *) part=$remaining; remaining= ;; esac; [ -n "$part" ] || return 1; prefix="$prefix/$part"; [ ! -L "$prefix" ] || return 1; done; }; cleanup_scratch() { [ -n "$scratch_dir" ] || return 0; case "$scratch_dir" in "$scratch_root"/runtime-identity.*) ;; *) return 1 ;; esac; [ -d "$scratch_dir" ] && [ ! -L "$scratch_dir" ] || return 1; rm -rf -- "$scratch_dir" || return 1; scratch_dir=; }; on_exit() { status=$1; trap - EXIT; if ! cleanup_scratch; then status=1; fi; exit "$status"; }; trap 'status=$?; on_exit "$status"' EXIT; trap 'exit 129' HUP; trap 'exit 130' INT; trap 'exit 143' TERM; disable() { reason=$1; if ! cleanup_scratch; then printf 'enabled=false\nreason=identity_scratch_cleanup_failed\n' >> "$GITHUB_OUTPUT"; exit 1; fi; printf 'enabled=false\nreason=%s\n' "$reason" >> "$GITHUB_OUTPUT"; exit 0; }; case "$VELNOR_CACHE_LANE" in scale-set:*) disable scale_set_image_unqualified ;; esac; case "$VELNOR_CACHE_LANE" in ubuntu-22.04) expected_image_os=ubuntu22 ;; ubuntu-24.04) expected_image_os=ubuntu24 ;; ubuntu-26.04) expected_image_os=ubuntu26 ;; *) disable lane_image_unqualified ;; esac; expected_arch=X64; expected_target=x86_64-unknown-linux-gnu; [ -n "$runner_os" ] || disable runner_os_missing; [ "$runner_os" = Linux ] || disable runner_os_mismatch; [ -n "$runner_arch" ] || disable runner_arch_missing; [ "$runner_arch" = "$expected_arch" ] || disable runner_arch_mismatch; [ -n "$image_os" ] || disable image_os_missing; [ "$image_os" = "$expected_image_os" ] || disable image_os_mismatch; [ -n "$home" ] && [ -d "$home" ] || disable home_missing; [ -n "$runner_temp" ] && [ -d "$runner_temp" ] || disable runner_temp_missing; valid_path "$home" || disable home_aliased; valid_path "$runner_temp" || disable runner_temp_aliased; expected_mise="$home/.local/share/mise"; effective_mise=${MISE_DATA_DIR-}; if [ -z "$effective_mise" ]; then if [ -n "${XDG_DATA_HOME-}" ]; then effective_mise="$XDG_DATA_HOME/mise"; else effective_mise=$expected_mise; fi; fi; valid_path "$expected_mise" || disable mise_root_aliased; valid_path "$effective_mise" || disable mise_root_invalid; [ "$effective_mise" = "$expected_mise" ] || disable mise_root_not_archived; expected_rustup="$runner_temp/velnor/rustup"; expected_cargo="$runner_temp/velnor/cargo"; [ "$mise_rustup" = "$expected_rustup" ] || disable mise_rustup_home_mismatch; [ "$rustup_home" = "$expected_rustup" ] || disable rustup_home_mismatch; [ "$mise_cargo" = "$expected_cargo" ] || disable mise_cargo_home_mismatch; [ "$cargo_home" = "$expected_cargo" ] || disable cargo_home_mismatch; valid_path "$expected_rustup" || disable rustup_root_invalid; valid_path "$expected_cargo" || disable cargo_root_invalid; scratch_root="$runner_temp/velnor"; valid_path "$scratch_root" || disable cache_scratch_aliased; mkdir -p "$scratch_root" || disable cache_scratch_unavailable; [ -d "$scratch_root" ] && [ ! -L "$scratch_root" ] || disable cache_scratch_invalid; scratch_dir="$scratch_root/runtime-identity.$$"; if ! mkdir -m 700 "$scratch_dir"; then scratch_dir=; disable identity_scratch_unavailable; fi; case "$scratch_dir" in "$scratch_root"/runtime-identity.*) ;; *) disable cache_scratch_invalid ;; esac; valid_path "$scratch_dir" && [ -d "$scratch_dir" ] && [ ! -L "$scratch_dir" ] || disable cache_scratch_invalid; identity_file="$scratch_dir/preimage"; sum_file="$scratch_dir/digest"; set -C; if ! : > "$identity_file"; then set +C; disable identity_file_unavailable; fi; if ! : > "$sum_file"; then set +C; disable identity_file_unavailable; fi; set +C; valid_path "$identity_file" && [ -f "$identity_file" ] && [ ! -L "$identity_file" ] || disable identity_file_invalid; valid_path "$sum_file" && [ -f "$sum_file" ] && [ ! -L "$sum_file" ] || disable identity_file_invalid; for value in "velnor-tools-runtime-v3" "$VELNOR_CACHE_STATIC_DIGEST" "$VELNOR_CACHE_LANE" "$expected_target" "$runner_os" "$runner_arch" "$image_os" "$home" "$runner_temp" "$effective_mise" "$expected_rustup" "$expected_cargo"; do if ! printf '%s:%s\n' "${#value}" "$value" >> "$identity_file"; then disable identity_file_write_failed; fi; done; if command -v sha256sum >/dev/null 2>&1; then if ! sha256sum < "$identity_file" > "$sum_file"; then disable identity_hash_failed; fi; elif command -v shasum >/dev/null 2>&1; then if ! shasum -a 256 < "$identity_file" > "$sum_file"; then disable identity_hash_failed; fi; else disable sha256_tool_missing; fi; if ! IFS=' ' read -r fingerprint _ < "$sum_file"; then disable fingerprint_missing; fi; [ ${#fingerprint} -eq 64 ] || disable fingerprint_invalid; case "$fingerprint" in *[!0-9a-f]*) disable fingerprint_invalid ;; esac; if ! cleanup_scratch; then disable identity_scratch_cleanup_failed; fi; printf 'identity=%s\nenabled=true\nreason=qualified_hosted_image\n' "$fingerprint" >> "$GITHUB_OUTPUT" \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9b0a9db..0a54ca9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,9 +1,10 @@ -# Generated by Velnor Actions 0.1.0; edit .velnor/config.toml and regenerate. +# Generated by Velnor Actions 0.1.80; edit .velnor/config.toml and regenerate. name: CI "on": pull_request: types: - opened + - edited - synchronize - reopened - ready_for_review @@ -13,288 +14,228 @@ name: CI merge_group: permissions: contents: read - actions: read +cache-mode: read +env: + ACTIONS_ID_TOKEN_REQUEST_TOKEN: "" + ACTIONS_ID_TOKEN_REQUEST_URL: "" + ACTIONS_RUNTIME_TOKEN: "" + CARGO_REGISTRY_TOKEN: "" + GH_CONFIG_DIR: "" + GH_HOST: "" + GH_TOKEN: "" + GITHUB_TOKEN: "" + MISE_AUTO_INSTALL: "false" + MISE_EXEC_AUTO_INSTALL: "false" + MISE_GITHUB_TOKEN: "" + MISE_LOCKFILE: "0" + MISE_NO_CONFIG: "1" + MISE_NO_ENV: "1" + MISE_NO_HOOKS: "1" + MISE_QUIET: "1" + NODE_AUTH_TOKEN: "" + NPM_TOKEN: "" concurrency: group: velnor-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: - actionlint: - name: Actionlint + jactionlint: + name: Jactionlint runs-on: ubuntu-26.04 - timeout-minutes: 10 + timeout-minutes: 5 + env: + VELNOR_RUN_KEY_ATTEMPT: ${{ github.run_attempt }} steps: - name: Checkout uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 with: persist-credentials: "false" - name: Setup Mise - uses: jdx/mise-action@9149ea85001c7435d5a66bb127d6a1b6227cb0a5 + uses: jdx/mise-action@f5be966e4a917d54244728e6a5fdcd1d93a35e6c with: - cache: "true" - cache_key: mise-v1-x86_64-unknown-linux-gnu-2026.9.18-75c77caa4018556f + cache: "false" cache_save: "false" env: "false" install: "false" - sha256: d24fe0bf7e613824ad99f7b8dac3f2b381a37b9f75f84dd250855217095a8de4 - version: 2026.9.18 - - name: Run actionlint - run: mise --no-config --no-env --no-hooks exec actionlint@1.7.12 shellcheck@0.11.0 -- actionlint -color - - name: Save Mise tools - if: success() && github.event_name == 'push' - uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 + sha256: 7129dbab31d698f9028db9374f7ba7987232b0426f837dcbce437130a61415f9 + version: 2026.11.1 + - name: V2 identity + id: v2 + uses: ./.github/actions/velnor-tools-prelude-u26 # zizmor: ignore[self-repository] with: - key: mise-v1-x86_64-unknown-linux-gnu-2026.9.18-75c77caa4018556f - path: ~/.local/share/mise + d: 36cc6f04cfd6a90146951553babc9b614ebf899d0f0210122f817d1097748c2c + - name: Restore Mise tools + id: tools-restore + if: steps.v2.outputs.enabled == 'true' + uses: ./.github/actions/velnor-tools-cache-restore # zizmor: ignore[self-repository] + with: + key: mise-tools-v2-${{steps.v2.outputs.identity}} + mise-sha256: 7129dbab31d698f9028db9374f7ba7987232b0426f837dcbce437130a61415f9 + seed-admitted: ${{ steps.v2.outputs.seed_admitted }} + - name: Prepare pinned tools + run: mise --no-config --no-env --no-hooks install jactionlint@2.4.0 shellcheck@0.11.0 + - name: Verify jactionlint + uses: ./.github/actions/velnor-verify-jactionlint # zizmor: ignore[self-repository] + - name: Run jactionlint + run: "bash -c 'unset ACTIONS_ID_TOKEN_REQUEST_TOKEN ACTIONS_ID_TOKEN_REQUEST_URL ACTIONS_RUNTIME_TOKEN GITHUB_TOKEN MISE_GITHUB_TOKEN GH_TOKEN GH_HOST GH_CONFIG_DIR; files=(); while IFS= read -r file; do files+=(\"$file\"); done < <({ find .github/workflows -maxdepth 1 -type f -name \"*.y*ml\"; find .github/actions -type f -name \"action.y*ml\"; find .github -maxdepth 1 -type f -name \"dependabot.y*ml\"; } 2>/dev/null | LC_ALL=C sort); if [ \"${#files[@]}\" -eq 0 ]; then echo \"jactionlint: no workflow files matched\" >&2; exit 3; fi; exec mise --no-config --no-env --no-hooks exec jactionlint@2.4.0 shellcheck@0.11.0 -- jactionlint --config-file .github/jactionlint.yaml --format github --strict-exit --no-online --shellcheck=shellcheck --pyflakes= --no-color \"${files[@]}\"'" plan: name: Plan runs-on: ubuntu-26.04 - timeout-minutes: 10 + timeout-minutes: 5 + env: + VELNOR_ASSET_SHA256: ac64d353024a8956c7ebe81c7c03ad5207f004bdb1d4624972ccdfacb789bcee + VELNOR_ASSET_URL: https://github.com/tailrocks/velnor-new/releases/download/v0.1.80/velnor-actions-0.1.80-x86_64-unknown-linux-gnu + VELNOR_RELEASE_COMMIT: b71a0045e42f6a8b620aa9283d0106bed622fe3b + VELNOR_RUN_KEY_ATTEMPT: ${{ github.run_attempt }} outputs: - covered_tasks: ${{ steps.plan.outputs.covered_tasks }} + not_affected_jobs: ${{ steps.plan.outputs.not_affected_jobs }} + qualification_campaign: ${{ steps.plan.outputs.qualification_campaign }} + qualification_phase: ${{ steps.plan.outputs.qualification_phase }} + qualification_cache_enabled: ${{ steps.plan.outputs.qualification_cache_enabled }} + qualification_cache_write: ${{ steps.plan.outputs.qualification_cache_write }} + qualification_cache_directives: ${{ steps.plan.outputs.qualification_cache_directives }} + plan_attempt: ${{ github.run_attempt }} steps: - name: Checkout uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 with: - fetch-depth: "0" + fetch-depth: ${{ github.event_name == 'push' && '1' || '0' }} persist-credentials: "false" - name: Setup Mise - uses: jdx/mise-action@9149ea85001c7435d5a66bb127d6a1b6227cb0a5 + uses: jdx/mise-action@f5be966e4a917d54244728e6a5fdcd1d93a35e6c with: - cache: "true" - cache_key: mise-v1-x86_64-unknown-linux-gnu-2026.9.18-761a279144527661 + cache: "false" cache_save: "false" env: "false" install: "false" - sha256: d24fe0bf7e613824ad99f7b8dac3f2b381a37b9f75f84dd250855217095a8de4 - version: 2026.9.18 + sha256: 7129dbab31d698f9028db9374f7ba7987232b0426f837dcbce437130a61415f9 + version: 2026.11.1 + - name: V2 identity + id: v2 + uses: ./.github/actions/velnor-tools-prelude-u26 # zizmor: ignore[self-repository] + with: + d: 36cc6f04cfd6a90146951553babc9b614ebf899d0f0210122f817d1097748c2c + - name: Restore Mise tools + id: tools-restore + if: steps.v2.outputs.enabled == 'true' + uses: ./.github/actions/velnor-tools-cache-restore # zizmor: ignore[self-repository] + with: + key: mise-tools-v2-${{steps.v2.outputs.identity}} + mise-sha256: 7129dbab31d698f9028db9374f7ba7987232b0426f837dcbce437130a61415f9 + seed-admitted: ${{ steps.v2.outputs.seed_admitted }} - name: Prepare pinned tools - env: - MISE_CARGO_HOME: ${{ runner.temp }}/velnor/cargo - MISE_LOCKFILE: "0" - MISE_NO_CONFIG: "1" - MISE_NO_ENV: "1" - MISE_NO_HOOKS: "1" - MISE_RUSTUP_HOME: ${{ runner.temp }}/velnor/rustup - RUSTUP_TOOLCHAIN: 1.98.1 - run: mise --no-config --no-env --no-hooks install rust@1.98.1 actionlint@1.7.12 shellcheck@0.11.0 zizmor@1.30.1 - - name: Prepare Rust components - env: - MISE_AUTO_INSTALL: "false" - MISE_CARGO_HOME: ${{ runner.temp }}/velnor/cargo - MISE_EXEC_AUTO_INSTALL: "false" - MISE_LOCKFILE: "0" - MISE_NO_CONFIG: "1" - MISE_NO_ENV: "1" - MISE_NO_HOOKS: "1" - MISE_RUSTUP_HOME: ${{ runner.temp }}/velnor/rustup - RUSTUP_TOOLCHAIN: 1.98.1 - run: mise --no-config --no-env --no-hooks exec rust@1.98.1 -- rustup component add --toolchain 1.98.1-x86_64-unknown-linux-gnu clippy rustfmt + run: mise --no-config --no-env --no-hooks install jactionlint@2.4.0 shellcheck@0.11.0 + - name: Verify jactionlint + uses: ./.github/actions/velnor-verify-jactionlint # zizmor: ignore[self-repository] - name: Acquire Velnor - env: - ACTIONS_ID_TOKEN_REQUEST_TOKEN: "" - ACTIONS_ID_TOKEN_REQUEST_URL: "" - ACTIONS_RUNTIME_TOKEN: "" - CARGO_REGISTRY_TOKEN: "" - GH_CONFIG_DIR: "" - GH_HOST: "" - GH_TOKEN: "" - GITHUB_TOKEN: "" - MISE_GITHUB_TOKEN: "" - NODE_AUTH_TOKEN: "" - NPM_TOKEN: "" - VELNOR_ASSET_SHA256: aa7e44d6579e9c586106d120ed3658fcf1c9b041027ad9f03473e8efacd3b5d5 - VELNOR_ASSET_URL: https://github.com/tailrocks/velnor-new/releases/download/v0.1.0/velnor-actions-0.1.0-x86_64-unknown-linux-gnu - VELNOR_RELEASE_COMMIT: c57c700459bbe1549fe7eedcb7d8689585c38986 - run: "sh -c 'unset ACTIONS_ID_TOKEN_REQUEST_TOKEN ACTIONS_ID_TOKEN_REQUEST_URL ACTIONS_RUNTIME_TOKEN GITHUB_TOKEN MISE_GITHUB_TOKEN GH_TOKEN GH_HOST GH_CONFIG_DIR; mkdir -p \"$RUNNER_TEMP/velnor/bin\" && curl -fsSL --proto '\\''=https'\\'' --tlsv1.2 \"$VELNOR_ASSET_URL\" -o \"$RUNNER_TEMP/velnor/bin/velnor-actions-0.1.0\" && echo \"$VELNOR_ASSET_SHA256 $RUNNER_TEMP/velnor/bin/velnor-actions-0.1.0\" | sha256sum -c - && chmod +x \"$RUNNER_TEMP/velnor/bin/velnor-actions-0.1.0\"'" + timeout-minutes: 6 + run: "sh -c 'unset ACTIONS_ID_TOKEN_REQUEST_TOKEN ACTIONS_ID_TOKEN_REQUEST_URL ACTIONS_RUNTIME_TOKEN GITHUB_TOKEN MISE_GITHUB_TOKEN GH_TOKEN GH_HOST GH_CONFIG_DIR; d=\"$RUNNER_TEMP/velnor/bin/velnor-actions-0.1.80\"&&mkdir -p \"${d%/*}\"&&s=\"/opt/velnor/seed/generator/${d##*/}\"&&p=\"$VELNOR_ASSET_SHA256 \"&&if [ -f \"$s\" ]&&echo \"$p$s\"|sha256sum -c -;then cp \"$s\" \"$d\";else curl -fsSL --connect-timeout 15 --max-time 120 --retry 5 --retry-all-errors --retry-max-time 180 --proto '\\''=https'\\'' --tlsv1.2 \"$VELNOR_ASSET_URL\" -o \"$d\"&&echo \"$p$d\"|sha256sum -c -;fi&&chmod +x \"$d\"'" - name: Write request env: VELNOR_INTERNAL_OP: write-request-v1 VELNOR_REQUEST_FILE: ${{ runner.temp }}/velnor/request/plan-v1-request.json - run: "\"$RUNNER_TEMP/velnor/bin/velnor-actions-0.1.0\"" + run: "\"$RUNNER_TEMP\"'/velnor/bin/velnor-actions-0.1.80'" - name: Check generated files - env: - ACTIONS_ID_TOKEN_REQUEST_TOKEN: "" - ACTIONS_ID_TOKEN_REQUEST_URL: "" - ACTIONS_RUNTIME_TOKEN: "" - CARGO_REGISTRY_TOKEN: "" - GH_CONFIG_DIR: "" - GH_HOST: "" - GH_TOKEN: "" - GITHUB_TOKEN: "" - MISE_AUTO_INSTALL: "false" - MISE_CARGO_HOME: ${{ runner.temp }}/velnor/cargo - MISE_EXEC_AUTO_INSTALL: "false" - MISE_GITHUB_TOKEN: "" - MISE_LOCKFILE: "0" - MISE_NO_CONFIG: "1" - MISE_NO_ENV: "1" - MISE_NO_HOOKS: "1" - MISE_RUSTUP_HOME: ${{ runner.temp }}/velnor/rustup - NODE_AUTH_TOKEN: "" - NPM_TOKEN: "" - RUSTUP_TOOLCHAIN: 1.98.1 - run: "sh -c 'unset ACTIONS_ID_TOKEN_REQUEST_TOKEN ACTIONS_ID_TOKEN_REQUEST_URL ACTIONS_RUNTIME_TOKEN GITHUB_TOKEN MISE_GITHUB_TOKEN GH_TOKEN GH_HOST GH_CONFIG_DIR; $RUNNER_TEMP/velnor/bin/velnor-actions-0.1.0 generate --output-dir \"$RUNNER_TEMP/velnor-actions-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}\" && diff -r --brief .github \"$RUNNER_TEMP/velnor-actions-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}/.github\"'" + run: "sh -c 'unset ACTIONS_ID_TOKEN_REQUEST_TOKEN ACTIONS_ID_TOKEN_REQUEST_URL ACTIONS_RUNTIME_TOKEN GITHUB_TOKEN MISE_GITHUB_TOKEN GH_TOKEN GH_HOST GH_CONFIG_DIR; $RUNNER_TEMP/velnor/bin/velnor-actions-0.1.80 generate --output-dir \"$RUNNER_TEMP/velnor-actions-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}\" && diff -r --brief .github \"$RUNNER_TEMP/velnor-actions-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}/.github\"'" - name: Plan id: plan env: + GH_TOKEN: ${{ github.token }} VELNOR_INTERNAL_OP: plan-v1 VELNOR_REQUEST_FILE: ${{ runner.temp }}/velnor/request/plan-v1-request.json - MISE_AUTO_INSTALL: "false" - MISE_CARGO_HOME: ${{ runner.temp }}/velnor/cargo - MISE_EXEC_AUTO_INSTALL: "false" - MISE_LOCKFILE: "0" - MISE_NO_CONFIG: "1" - MISE_NO_ENV: "1" - MISE_NO_HOOKS: "1" - MISE_RUSTUP_HOME: ${{ runner.temp }}/velnor/rustup - RUSTUP_TOOLCHAIN: 1.98.1 - run: "\"$RUNNER_TEMP/velnor/bin/velnor-actions-0.1.0\"" + run: "\"$RUNNER_TEMP\"'/velnor/bin/velnor-actions-0.1.80'" - name: Publish plan if: always() - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 with: if-no-files-found: error - name: velnor-plan-r${{ github.run_id }}-a${{ github.run_attempt }} - path: ${{ runner.temp }}/velnor/r${{ github.run_id }}-a${{ github.run_attempt }} + name: velnor-plan-r${{ github.run_id }}-a${{ env.VELNOR_RUN_KEY_ATTEMPT }} + path: ${{ runner.temp }}/velnor/r${{ github.run_id }}-a${{ env.VELNOR_RUN_KEY_ATTEMPT }} retention-days: "30" - - name: Save Mise tools - if: success() && github.event_name == 'push' - uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 - with: - key: mise-v1-x86_64-unknown-linux-gnu-2026.9.18-761a279144527661 - path: ~/.local/share/mise - publish-baseline: - name: Publish baseline - runs-on: ubuntu-26.04 - timeout-minutes: 10 - needs: - - required - if: github.event_name == 'push' && github.ref == 'refs/heads/main' - steps: - - name: Acquire Velnor - env: - ACTIONS_ID_TOKEN_REQUEST_TOKEN: "" - ACTIONS_ID_TOKEN_REQUEST_URL: "" - ACTIONS_RUNTIME_TOKEN: "" - CARGO_REGISTRY_TOKEN: "" - GH_CONFIG_DIR: "" - GH_HOST: "" - GH_TOKEN: "" - GITHUB_TOKEN: "" - MISE_GITHUB_TOKEN: "" - NODE_AUTH_TOKEN: "" - NPM_TOKEN: "" - VELNOR_ASSET_SHA256: aa7e44d6579e9c586106d120ed3658fcf1c9b041027ad9f03473e8efacd3b5d5 - VELNOR_ASSET_URL: https://github.com/tailrocks/velnor-new/releases/download/v0.1.0/velnor-actions-0.1.0-x86_64-unknown-linux-gnu - VELNOR_RELEASE_COMMIT: c57c700459bbe1549fe7eedcb7d8689585c38986 - run: "sh -c 'unset ACTIONS_ID_TOKEN_REQUEST_TOKEN ACTIONS_ID_TOKEN_REQUEST_URL ACTIONS_RUNTIME_TOKEN GITHUB_TOKEN MISE_GITHUB_TOKEN GH_TOKEN GH_HOST GH_CONFIG_DIR; mkdir -p \"$RUNNER_TEMP/velnor/bin\" && curl -fsSL --proto '\\''=https'\\'' --tlsv1.2 \"$VELNOR_ASSET_URL\" -o \"$RUNNER_TEMP/velnor/bin/velnor-actions-0.1.0\" && echo \"$VELNOR_ASSET_SHA256 $RUNNER_TEMP/velnor/bin/velnor-actions-0.1.0\" | sha256sum -c - && chmod +x \"$RUNNER_TEMP/velnor/bin/velnor-actions-0.1.0\"'" - - name: Download plan - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c - with: - name: velnor-plan-r${{ github.run_id }}-a${{ github.run_attempt }} - path: ${{ runner.temp }}/velnor/r${{ github.run_id }}-a${{ github.run_attempt }} - - name: Write request - env: - VELNOR_INTERNAL_OP: write-request-v1 - VELNOR_REQUEST_FILE: ${{ runner.temp }}/velnor/request/publish-baseline-v1-request.json - run: "\"$RUNNER_TEMP/velnor/bin/velnor-actions-0.1.0\"" - - name: Publish baseline - id: publish-baseline - env: - VELNOR_INTERNAL_OP: publish-baseline-v1 - VELNOR_REQUEST_FILE: ${{ runner.temp }}/velnor/request/publish-baseline-v1-request.json - run: "\"$RUNNER_TEMP/velnor/bin/velnor-actions-0.1.0\"" - - name: Upload baseline - if: always() - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a - with: - if-no-files-found: error - name: ${{ steps.publish-baseline.outputs.artifact_name }} - path: ${{ runner.temp }}/velnor/r${{ github.run_id }}-a${{ github.run_attempt }}/baseline.json - retention-days: "90" required: - name: Required + name: Required verdict runs-on: ubuntu-26.04 - timeout-minutes: 10 + timeout-minutes: 15 + env: + VELNOR_ASSET_SHA256: ac64d353024a8956c7ebe81c7c03ad5207f004bdb1d4624972ccdfacb789bcee + VELNOR_ASSET_URL: https://github.com/tailrocks/velnor-new/releases/download/v0.1.80/velnor-actions-0.1.80-x86_64-unknown-linux-gnu + VELNOR_RELEASE_COMMIT: b71a0045e42f6a8b620aa9283d0106bed622fe3b + VELNOR_RUN_KEY_ATTEMPT: ${{ needs.plan.outputs.plan_attempt || github.run_attempt }} + permissions: + contents: read + actions: read needs: - plan - - actionlint - if: always() + - jactionlint + if: ${{ !cancelled() }} steps: + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 + with: + fetch-depth: ${{ github.event_name == 'push' && '1' || '2' }} + persist-credentials: "false" - name: Setup Mise - uses: jdx/mise-action@9149ea85001c7435d5a66bb127d6a1b6227cb0a5 + uses: jdx/mise-action@f5be966e4a917d54244728e6a5fdcd1d93a35e6c with: - cache: "true" - cache_key: mise-v1-x86_64-unknown-linux-gnu-2026.9.18-14ee3a9bbb90604c + cache: "false" cache_save: "false" env: "false" install: "false" - sha256: d24fe0bf7e613824ad99f7b8dac3f2b381a37b9f75f84dd250855217095a8de4 - version: 2026.9.18 + sha256: 7129dbab31d698f9028db9374f7ba7987232b0426f837dcbce437130a61415f9 + version: 2026.11.1 - name: Acquire Velnor - env: - ACTIONS_ID_TOKEN_REQUEST_TOKEN: "" - ACTIONS_ID_TOKEN_REQUEST_URL: "" - ACTIONS_RUNTIME_TOKEN: "" - CARGO_REGISTRY_TOKEN: "" - GH_CONFIG_DIR: "" - GH_HOST: "" - GH_TOKEN: "" - GITHUB_TOKEN: "" - MISE_GITHUB_TOKEN: "" - NODE_AUTH_TOKEN: "" - NPM_TOKEN: "" - VELNOR_ASSET_SHA256: aa7e44d6579e9c586106d120ed3658fcf1c9b041027ad9f03473e8efacd3b5d5 - VELNOR_ASSET_URL: https://github.com/tailrocks/velnor-new/releases/download/v0.1.0/velnor-actions-0.1.0-x86_64-unknown-linux-gnu - VELNOR_RELEASE_COMMIT: c57c700459bbe1549fe7eedcb7d8689585c38986 - run: "sh -c 'unset ACTIONS_ID_TOKEN_REQUEST_TOKEN ACTIONS_ID_TOKEN_REQUEST_URL ACTIONS_RUNTIME_TOKEN GITHUB_TOKEN MISE_GITHUB_TOKEN GH_TOKEN GH_HOST GH_CONFIG_DIR; mkdir -p \"$RUNNER_TEMP/velnor/bin\" && curl -fsSL --proto '\\''=https'\\'' --tlsv1.2 \"$VELNOR_ASSET_URL\" -o \"$RUNNER_TEMP/velnor/bin/velnor-actions-0.1.0\" && echo \"$VELNOR_ASSET_SHA256 $RUNNER_TEMP/velnor/bin/velnor-actions-0.1.0\" | sha256sum -c - && chmod +x \"$RUNNER_TEMP/velnor/bin/velnor-actions-0.1.0\"'" + timeout-minutes: 6 + run: "sh -c 'unset ACTIONS_ID_TOKEN_REQUEST_TOKEN ACTIONS_ID_TOKEN_REQUEST_URL ACTIONS_RUNTIME_TOKEN GITHUB_TOKEN MISE_GITHUB_TOKEN GH_TOKEN GH_HOST GH_CONFIG_DIR; d=\"$RUNNER_TEMP/velnor/bin/velnor-actions-0.1.80\"&&mkdir -p \"${d%/*}\"&&s=\"/opt/velnor/seed/generator/${d##*/}\"&&p=\"$VELNOR_ASSET_SHA256 \"&&if [ -f \"$s\" ]&&echo \"$p$s\"|sha256sum -c -;then cp \"$s\" \"$d\";else curl -fsSL --connect-timeout 15 --max-time 120 --retry 5 --retry-all-errors --retry-max-time 180 --proto '\\''=https'\\'' --tlsv1.2 \"$VELNOR_ASSET_URL\" -o \"$d\"&&echo \"$p$d\"|sha256sum -c -;fi&&chmod +x \"$d\"'" - name: Prepare pinned tools - env: - MISE_CARGO_HOME: ${{ runner.temp }}/velnor/cargo - MISE_LOCKFILE: "0" - MISE_NO_CONFIG: "1" - MISE_NO_ENV: "1" - MISE_NO_HOOKS: "1" - MISE_RUSTUP_HOME: ${{ runner.temp }}/velnor/rustup - RUSTUP_TOOLCHAIN: 1.98.1 - run: mise --no-config --no-env --no-hooks install gh@2.102.0 + run: mise --no-config --no-env --no-hooks install gh@2.103.3 - name: Download plan continue-on-error: true - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c + uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 with: - name: velnor-plan-r${{ github.run_id }}-a${{ github.run_attempt }} - path: ${{ runner.temp }}/velnor/r${{ github.run_id }}-a${{ github.run_attempt }} + name: velnor-plan-r${{ github.run_id }}-a${{ env.VELNOR_RUN_KEY_ATTEMPT }} + path: ${{ runner.temp }}/velnor/r${{ github.run_id }}-a${{ env.VELNOR_RUN_KEY_ATTEMPT }} - name: Download every expected matrix artifact env: GH_REPO: ${{ github.repository }} GH_TOKEN: ${{ github.token }} VELNOR_INTERNAL_OP: fetch-reports-v1 - run: "\"$RUNNER_TEMP/velnor/bin/velnor-actions-0.1.0\"" + run: "\"$RUNNER_TEMP\"'/velnor/bin/velnor-actions-0.1.80'" + - name: Assemble group ledgers + env: + VELNOR_INTERNAL_OP: assemble-group-ledgers-v1 + run: "\"$RUNNER_TEMP\"'/velnor/bin/velnor-actions-0.1.80'" - name: Write request env: VELNOR_INTERNAL_OP: write-request-v1 VELNOR_NEEDS_JSON: ${{ toJSON(needs) }} - VELNOR_NEEDS_EXPECTED: "[\"actionlint\",\"plan\"]" + VELNOR_NEEDS_EXPECTED: "[\"jactionlint\",\"plan\"]" VELNOR_REQUEST_FILE: ${{ runner.temp }}/velnor/request/merge-v1-request.json - run: "\"$RUNNER_TEMP/velnor/bin/velnor-actions-0.1.0\"" + run: "\"$RUNNER_TEMP\"'/velnor/bin/velnor-actions-0.1.80'" - name: Merge reports env: + GH_TOKEN: ${{ github.token }} VELNOR_INTERNAL_OP: merge-v1 VELNOR_NEEDS_JSON: ${{ toJSON(needs) }} - VELNOR_NEEDS_EXPECTED: "[\"actionlint\",\"plan\"]" + VELNOR_NEEDS_EXPECTED: "[\"jactionlint\",\"plan\"]" VELNOR_REQUEST_FILE: ${{ runner.temp }}/velnor/request/merge-v1-request.json - run: "\"$RUNNER_TEMP/velnor/bin/velnor-actions-0.1.0\"" - - name: Save Mise tools - if: success() && github.event_name == 'push' - uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 - with: - key: mise-v1-x86_64-unknown-linux-gnu-2026.9.18-14ee3a9bbb90604c - path: ~/.local/share/mise + run: "\"$RUNNER_TEMP\"'/velnor/bin/velnor-actions-0.1.80'" - name: Publish final report if: always() - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 with: if-no-files-found: error name: velnor-final-r${{ github.run_id }}-a${{ github.run_attempt }} - path: ${{ runner.temp }}/velnor/r${{ github.run_id }}-a${{ github.run_attempt }}/final-report.json + path: ${{ runner.temp }}/velnor/r${{ github.run_id }}-a${{ env.VELNOR_RUN_KEY_ATTEMPT }}/final-report.json retention-days: "30" + required-gate: + name: Required + runs-on: ubuntu-26.04 + timeout-minutes: 15 + env: + VELNOR_RUN_KEY_ATTEMPT: ${{ github.run_attempt }} + needs: + - required + if: ${{ always() }} + steps: + - name: Fail unless the verdict passed + if: ${{ always() && needs.required.result != 'success' }} + run: env -u ACTIONS_ID_TOKEN_REQUEST_TOKEN -u ACTIONS_ID_TOKEN_REQUEST_URL -u ACTIONS_RUNTIME_TOKEN -u GITHUB_TOKEN -u MISE_GITHUB_TOKEN -u GH_TOKEN -u GH_HOST -u GH_CONFIG_DIR false diff --git a/.github/workflows/state-seal.yml b/.github/workflows/state-seal.yml new file mode 100644 index 0000000..b02b4de --- /dev/null +++ b/.github/workflows/state-seal.yml @@ -0,0 +1,179 @@ +# Generated by Velnor Actions 0.1.80; edit .velnor/config.toml and regenerate. +name: State seal +"on": + push: + branches: + - main +permissions: + contents: read +cache-mode: read +env: + ACTIONS_ID_TOKEN_REQUEST_TOKEN: "" + ACTIONS_ID_TOKEN_REQUEST_URL: "" + ACTIONS_RUNTIME_TOKEN: "" + CARGO_REGISTRY_TOKEN: "" + GH_CONFIG_DIR: "" + GH_HOST: "" + GH_TOKEN: "" + GITHUB_TOKEN: "" + MISE_AUTO_INSTALL: "false" + MISE_EXEC_AUTO_INSTALL: "false" + MISE_GITHUB_TOKEN: "" + MISE_LOCKFILE: "0" + MISE_NO_CONFIG: "1" + MISE_NO_ENV: "1" + MISE_NO_HOOKS: "1" + MISE_QUIET: "1" + NODE_AUTH_TOKEN: "" + NPM_TOKEN: "" +concurrency: + group: velnor-state-seal-${{ github.ref }} + cancel-in-progress: false +jobs: + plan: + name: Plan + runs-on: ubuntu-26.04 + timeout-minutes: 5 + env: + VELNOR_ASSET_SHA256: ac64d353024a8956c7ebe81c7c03ad5207f004bdb1d4624972ccdfacb789bcee + VELNOR_ASSET_URL: https://github.com/tailrocks/velnor-new/releases/download/v0.1.80/velnor-actions-0.1.80-x86_64-unknown-linux-gnu + VELNOR_RELEASE_COMMIT: b71a0045e42f6a8b620aa9283d0106bed622fe3b + VELNOR_RUN_KEY_ATTEMPT: ${{ github.run_attempt }} + outputs: + plan_attempt: ${{ github.run_attempt }} + steps: + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 + with: + fetch-depth: ${{ github.event_name == 'push' && '1' || '0' }} + persist-credentials: "false" + - name: Setup Mise + uses: jdx/mise-action@f5be966e4a917d54244728e6a5fdcd1d93a35e6c + with: + cache: "false" + cache_save: "false" + env: "false" + install: "false" + sha256: 7129dbab31d698f9028db9374f7ba7987232b0426f837dcbce437130a61415f9 + version: 2026.11.1 + - name: V2 identity + id: v2 + uses: ./.github/actions/velnor-tools-prelude-u26 # zizmor: ignore[self-repository] + with: + d: 36cc6f04cfd6a90146951553babc9b614ebf899d0f0210122f817d1097748c2c + - name: Restore Mise tools + id: tools-restore + if: steps.v2.outputs.enabled == 'true' + uses: ./.github/actions/velnor-tools-cache-restore # zizmor: ignore[self-repository] + with: + key: mise-tools-v2-${{steps.v2.outputs.identity}} + mise-sha256: 7129dbab31d698f9028db9374f7ba7987232b0426f837dcbce437130a61415f9 + seed-admitted: ${{ steps.v2.outputs.seed_admitted }} + - name: Prepare pinned tools + run: mise --no-config --no-env --no-hooks install jactionlint@2.4.0 shellcheck@0.11.0 + - name: Verify jactionlint + uses: ./.github/actions/velnor-verify-jactionlint # zizmor: ignore[self-repository] + - name: Acquire Velnor + timeout-minutes: 6 + run: "sh -c 'unset ACTIONS_ID_TOKEN_REQUEST_TOKEN ACTIONS_ID_TOKEN_REQUEST_URL ACTIONS_RUNTIME_TOKEN GITHUB_TOKEN MISE_GITHUB_TOKEN GH_TOKEN GH_HOST GH_CONFIG_DIR; d=\"$RUNNER_TEMP/velnor/bin/velnor-actions-0.1.80\"&&mkdir -p \"${d%/*}\"&&s=\"/opt/velnor/seed/generator/${d##*/}\"&&p=\"$VELNOR_ASSET_SHA256 \"&&if [ -f \"$s\" ]&&echo \"$p$s\"|sha256sum -c -;then cp \"$s\" \"$d\";else curl -fsSL --connect-timeout 15 --max-time 120 --retry 5 --retry-all-errors --retry-max-time 180 --proto '\\''=https'\\'' --tlsv1.2 \"$VELNOR_ASSET_URL\" -o \"$d\"&&echo \"$p$d\"|sha256sum -c -;fi&&chmod +x \"$d\"'" + - name: Write request + env: + VELNOR_INTERNAL_OP: write-request-v1 + VELNOR_REQUEST_FILE: ${{ runner.temp }}/velnor/request/plan-v1-request.json + run: "\"$RUNNER_TEMP\"'/velnor/bin/velnor-actions-0.1.80'" + - name: Check generated files + run: "sh -c 'unset ACTIONS_ID_TOKEN_REQUEST_TOKEN ACTIONS_ID_TOKEN_REQUEST_URL ACTIONS_RUNTIME_TOKEN GITHUB_TOKEN MISE_GITHUB_TOKEN GH_TOKEN GH_HOST GH_CONFIG_DIR; $RUNNER_TEMP/velnor/bin/velnor-actions-0.1.80 generate --output-dir \"$RUNNER_TEMP/velnor-actions-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}\" && diff -r --brief .github \"$RUNNER_TEMP/velnor-actions-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}/.github\"'" + - name: Plan + id: plan + env: + GH_TOKEN: ${{ github.token }} + VELNOR_INTERNAL_OP: plan-v1 + VELNOR_REQUEST_FILE: ${{ runner.temp }}/velnor/request/plan-v1-request.json + run: "\"$RUNNER_TEMP\"'/velnor/bin/velnor-actions-0.1.80'" + - name: Publish plan + if: always() + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 + with: + if-no-files-found: error + name: velnor-plan-r${{ github.run_id }}-a${{ env.VELNOR_RUN_KEY_ATTEMPT }} + path: ${{ runner.temp }}/velnor/r${{ github.run_id }}-a${{ env.VELNOR_RUN_KEY_ATTEMPT }} + retention-days: "30" + tools-producer-36cc6f04: + name: Tools producer / 36cc6f04 + runs-on: ubuntu-26.04 + timeout-minutes: 5 + continue-on-error: true + env: + VELNOR_RUN_KEY_ATTEMPT: ${{ github.run_attempt }} + cache-mode: write + if: "!cancelled() && github.event_name == 'push' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && github.ref_protected == true" + steps: + - name: Record optional cache budget + id: velnor-cache-clock + run: "set -eu\nunavailable() { printf '%s\\n' '::warning::cache_unavailable: invalid first-step clock or output'; }\noutput=${GITHUB_OUTPUT-}\nseconds=${VELNOR_CACHE_JOB_SECONDS-}\nnow=$(date +%s) || now=\nfor value in \"$now\" \"$seconds\"; do\n case \"$value\" in ''|*[!0-9]*) unavailable; exit 0 ;; esac\n case \"$value\" in 0|[1-9]*) ;; *) unavailable; exit 0 ;; esac\n [ \"${#value}\" -le 10 ] || { unavailable; exit 0; }\ndone\nif [ -z \"$output\" ] || ! printf 'started=%s\\ndeadline=%s\\n' \"$now\" \"$((now + seconds))\" 2>/dev/null >> \"$output\"; then\n unavailable\nfi\n" + env: + VELNOR_CACHE_JOB_SECONDS: "300" + - name: Check state tip + id: state-seal-tip + env: + GH_TOKEN: ${{ github.token }} + VELNOR_DEFAULT_REF: ${{ format('refs/heads/{0}', github.event.repository.default_branch) }} + run: "sh -c 'set -eu; case \"$RUNNER_TEMP\" in /*) ;; *) printf '\\''%s\\n'\\'' '\\''RUNNER_TEMP must be absolute'\\'' >&2; exit 1 ;; esac; d=\"$RUNNER_TEMP/velnor/state-tip\"; rm -rf \"$d\"; mkdir -p \"$d\"; refuse() { printf '\\''%s\\n'\\'' \"::warning::cache_unavailable: state seal tip check refused ($1)\"; exit 1; }; head=\"${GITHUB_SHA-}\"; ref=\"${VELNOR_DEFAULT_REF-}\"; repo=\"${GITHUB_REPOSITORY-}\"; [ -n \"$head\" ] && [ -n \"$ref\" ] && [ -n \"$repo\" ] || refuse input_missing; command -v gh >/dev/null 2>&1 || refuse gh_missing; gh api \"repos/$repo/git/ref/${ref#refs/}\" --jq .object.sha > \"$d/tip\" 2> /dev/null || refuse tip_unreadable; tip=; read -r tip < \"$d/tip\" || :; case \"$tip\" in '\\'''\\''|*[!0-9a-f]*) refuse tip_malformed ;; esac; if [ \"$tip\" = \"$head\" ]; then printf '\\''%s\\n'\\'' '\\''current=true'\\'' >> \"$GITHUB_OUTPUT\"; printf '\\''velnor: state seal head %s is the tip of %s\\n'\\'' \"$head\" \"$ref\"; else printf '\\''velnor: state seal skipped: head %s is behind %s at %s; nothing saved or attested\\n'\\'' \"$head\" \"$ref\" \"$tip\"; exit 1; fi'" + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 + with: + persist-credentials: "false" + - name: Setup Mise + uses: jdx/mise-action@f5be966e4a917d54244728e6a5fdcd1d93a35e6c + with: + cache: "false" + cache_save: "false" + env: "false" + install: "false" + sha256: 7129dbab31d698f9028db9374f7ba7987232b0426f837dcbce437130a61415f9 + version: 2026.11.1 + - name: V2 identity + id: v2 + uses: ./.github/actions/velnor-tools-prelude-u26 # zizmor: ignore[self-repository] + with: + d: 36cc6f04cfd6a90146951553babc9b614ebf899d0f0210122f817d1097748c2c + - name: Probe Mise tools + id: tools-restore + if: steps.v2.outputs.enabled == 'true' + uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 + with: + key: mise-tools-v2-${{steps.v2.outputs.identity}} + lookup-only: "true" + path: "~/.local/share/mise\n${{ runner.temp }}/velnor/rustup\n${{ runner.temp }}/velnor/cargo/.crates.toml\n${{ runner.temp }}/velnor/cargo/.crates2.json\n${{ runner.temp }}/velnor/cargo/bin" + - name: Scrub and verify Mise tools + if: steps.v2.outputs.enabled == 'true' && steps.tools-restore.outputs.cache-hit != 'true' + uses: ./.github/actions/velnor-tools-cache-scrub # zizmor: ignore[self-repository] + with: + mise-sha256: 7129dbab31d698f9028db9374f7ba7987232b0426f837dcbce437130a61415f9 + - name: Prepare pinned tools + if: steps.v2.outputs.enabled == 'true' && steps.tools-restore.outputs.cache-hit != 'true' + run: mise --no-config --no-env --no-hooks install jactionlint@2.4.0 shellcheck@0.11.0 + - name: Verify jactionlint + if: steps.v2.outputs.enabled == 'true' && steps.tools-restore.outputs.cache-hit != 'true' + uses: ./.github/actions/velnor-verify-jactionlint # zizmor: ignore[self-repository] + - name: Admit optional cache save + id: velnor-optional-tools-save-budget + if: success() && github.event_name == 'push' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && github.ref_protected == true && steps.v2.outputs.enabled == 'true' && steps.tools-restore.outputs.cache-hit != 'true' + run: "set -eu\noutput=${GITHUB_OUTPUT-}\nemit() { [ -n \"$output\" ] && printf '%s\\n' \"$1\" 2>/dev/null >> \"$output\"; }\nrefuse() {\n emit 'admitted=false' || :\n printf '%s\\n' '::warning::cache_unavailable: optional save has no safe remaining job budget or output'\n}\nstarted=${VELNOR_CACHE_STARTED-}\ndeadline=${VELNOR_CACHE_DEADLINE-}\nseconds=${VELNOR_CACHE_JOB_SECONDS-}\nrequired=${VELNOR_CACHE_REQUIRED_SECONDS-}\nnow=$(date +%s) || now=\nfor value in \"$started\" \"$deadline\" \"$now\" \"$seconds\" \"$required\"; do\n case \"$value\" in ''|*[!0-9]*) refuse; exit 0 ;; esac\n case \"$value\" in 0|[1-9]*) ;; *) refuse; exit 0 ;; esac\n [ \"${#value}\" -le 10 ] || { refuse; exit 0; }\ndone\nif [ \"$now\" -lt \"$started\" ] || [ \"$deadline\" -lt \"$started\" ] ||\n [ \"$((deadline - started))\" -ne \"$seconds\" ] ||\n [ \"$((deadline - now))\" -lt \"$required\" ]; then\n refuse\nelif ! emit 'admitted=true'; then\n refuse\nfi\n" + env: + VELNOR_CACHE_JOB_SECONDS: "300" + VELNOR_CACHE_STARTED: ${{ steps.velnor-cache-clock.outputs.started }} + VELNOR_CACHE_DEADLINE: ${{ steps.velnor-cache-clock.outputs.deadline }} + VELNOR_CACHE_REQUIRED_SECONDS: "90" + - name: Save Mise tools + if: (success() && github.event_name == 'push' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && github.ref_protected == true && steps.v2.outputs.enabled == 'true' && steps.tools-restore.outputs.cache-hit != 'true') && steps.velnor-optional-tools-save-budget.outputs.admitted == 'true' + id: velnor-optional-tools-save + timeout-minutes: 1 + continue-on-error: true + uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 + with: + key: mise-tools-v2-${{steps.v2.outputs.identity}} + path: "~/.local/share/mise\n${{ runner.temp }}/velnor/rustup\n${{ runner.temp }}/velnor/cargo/.crates.toml\n${{ runner.temp }}/velnor/cargo/.crates2.json\n${{ runner.temp }}/velnor/cargo/bin" + - name: Report optional cache save failure + if: always() && !cancelled() && steps.velnor-optional-tools-save.outcome == 'failure' + run: "printf '%s\\n' '::warning::cache_unavailable: optional save failed or timed out'" diff --git a/.velnor/release-manifest.json b/.velnor/release-manifest.json index cd8c2a8..b7ccda5 100644 --- a/.velnor/release-manifest.json +++ b/.velnor/release-manifest.json @@ -1,18 +1,23 @@ { "schema": 1, - "version": "0.1.0", + "version": "0.1.80", "repository": "tailrocks/velnor-new", - "commit": "c57c700459bbe1549fe7eedcb7d8689585c38986", + "commit": "b71a0045e42f6a8b620aa9283d0106bed622fe3b", "targets": [ { "target": "x86_64-unknown-linux-gnu", - "artifact": "https://github.com/tailrocks/velnor-new/releases/download/v0.1.0/velnor-actions-0.1.0-x86_64-unknown-linux-gnu", - "sha256": "aa7e44d6579e9c586106d120ed3658fcf1c9b041027ad9f03473e8efacd3b5d5" + "artifact": "https://github.com/tailrocks/velnor-new/releases/download/v0.1.80/velnor-actions-0.1.80-x86_64-unknown-linux-gnu", + "sha256": "ac64d353024a8956c7ebe81c7c03ad5207f004bdb1d4624972ccdfacb789bcee" }, { "target": "aarch64-apple-darwin", - "artifact": "https://github.com/tailrocks/velnor-new/releases/download/v0.1.0/velnor-actions-0.1.0-aarch64-apple-darwin", - "sha256": "b6f514b71e3d1d72978c66cecf23560e7f25ad51727e9f26c88870b77d61695f" + "artifact": "https://github.com/tailrocks/velnor-new/releases/download/v0.1.80/velnor-actions-0.1.80-aarch64-apple-darwin", + "sha256": "26f52efa2b1a36255644d07915b2eca7a31a57495bb3a27029da6aceb45104d0" + }, + { + "target": "x86_64-apple-darwin", + "artifact": "https://github.com/tailrocks/velnor-new/releases/download/v0.1.80/velnor-actions-0.1.80-x86_64-apple-darwin", + "sha256": "e37fd97734d53fb744c298c3314bc223e378ca60532d939bac7b5b3e19a88478" } ] }