diff --git a/.gitea/workflows/lint-shellcheck-arm64-pilot.yml b/.gitea/workflows/lint-shellcheck-arm64-pilot.yml index 6e7f8a7a2..2b157a346 100644 --- a/.gitea/workflows/lint-shellcheck-arm64-pilot.yml +++ b/.gitea/workflows/lint-shellcheck-arm64-pilot.yml @@ -3,11 +3,26 @@ name: Lint shellcheck (arm64 pilot) # Mac-CI dual-track pilot (#233). ADDITIVE / NOT REQUIRED. # # Validates the arm64 self-hosted lane (no docker.sock, no privileged -# ops) before any required gate moves onto it. Until a Mac arm64 runner -# is registered with the `arm64` label, this workflow sits PENDING — -# that is FINE: `arm64` is NOT in branch_protections required contexts. +# ops) before any required gate moves onto it. # -# Pairs with internal#543 (RFC: Mac arm64 multi-arch runner-base). +# Runner label mapping (2026-05-22 fix): the actual Mac mini runner +# registered in this Gitea ships labels +# ["self-hosted","macos-self-hosted-arm64","arm64-darwin"] +# — no plain `arm64`. The earlier `runs-on: [self-hosted, arm64]` +# could not match any registered runner so every fire of this workflow +# was assigned task_id=0 / runner_id=NULL → Gitea cancelled it. The +# rows showed up as Cancelled in the action status feed (not Failed) +# but the lane never actually ran. Workflow now selects on +# `arm64-darwin` which is the canonical Mac-arm64 label per the +# Mac mini's registration (per internal#494 capability-honest labels). +# +# If we later want to add a Linux-arm64 runner to the same lane, add +# both labels to that runner's registration AND broaden the selector +# here — don't rename `arm64-darwin` (it's Mac-specific by design and +# `feedback_pc2_runner_labels_must_stay_narrow` rule applies). +# +# Pairs with internal#543 (RFC: Mac arm64 multi-arch runner-base) and +# internal#494 (multi-arch runner-base capability-honest labels). # No paths: filter on purpose (feedback_path_filtered_workflow_cant_be_required). on: @@ -82,7 +97,15 @@ jobs: echo "WARN: shellcheck binary not found — skipping (pilot mode)" exit 0 fi - mapfile -t TARGETS < <(find .gitea/scripts -maxdepth 2 -type f -name '*.sh' | sort) + # NOTE: macOS ships Bash 3.2 (Apple license), no `mapfile` + # (Bash 4+ builtin). Mac mini runner empirically failed at + # `mapfile: command not found` (run 79275 / task 145654). + # Use the portable `while read` pattern instead — works on + # both Bash 3.2 (macOS) and Bash 4+ (Linux). + TARGETS=() + while IFS= read -r f; do + TARGETS+=("$f") + done < <(find .gitea/scripts -maxdepth 2 -type f -name '*.sh' | sort) if [ "${#TARGETS[@]}" -eq 0 ]; then echo "No .sh files found under .gitea/scripts — nothing to check" exit 0