From f0dac9479aefdbbf410ede61afa3b5f1fea8c703 Mon Sep 17 00:00:00 2001 From: MelvinBot Date: Wed, 11 Feb 2026 17:57:29 +0000 Subject: [PATCH] Fix actionlint config path resolution after cd into REPO_ROOT After `cd "$REPO_ROOT"`, the config file checks still referenced `$REPO_ROOT/.github/actionlint.yml`, creating a double-nested path (e.g., FuzzyBot/FuzzyBot/.github/actionlint.yml) that never exists. This caused the script to always fall back to the GitHub-Actions default config, silently ignoring repo-local actionlint configs. Use paths relative to cwd (which is already inside the repo after the cd) instead of prefixing with $REPO_ROOT. Co-authored-by: Justin Persaud --- scripts/actionlint.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/scripts/actionlint.sh b/scripts/actionlint.sh index 482f685..a99c998 100755 --- a/scripts/actionlint.sh +++ b/scripts/actionlint.sh @@ -121,15 +121,16 @@ echo cd "$REPO_ROOT" || exit 1 # If a repo has it's own action lint config, use that. Otherwise, use the one in this repo. +# Note: we've already cd'd into $REPO_ROOT above, so use paths relative to cwd. CONFIG="" -if [[ ! -f "$REPO_ROOT/.github/actionlint.yml" ]] && [[ ! -f "$REPO_ROOT/.github/actionlint.yaml" ]]; then +if [[ ! -f ".github/actionlint.yml" ]] && [[ ! -f ".github/actionlint.yaml" ]]; then CONFIG=" -config-file $(readlink -f "$SCRIPT_DIR"/../.github/actionlint.yml)" info "Using default Github-Actions repo actionlint.yml" >&2 -else - if [[ -f "$REPO_ROOT/.github/actionlint.yml" ]]; then - CONFIG=" -config-file $(readlink -f "$REPO_ROOT/.github/actionlint.yml")" - elif [[ -f "$REPO_ROOT/.github/actionlint.yaml" ]]; then - CONFIG=" -config-file $(readlink -f "$REPO_ROOT/.github/actionlint.yaml")" +else + if [[ -f ".github/actionlint.yml" ]]; then + CONFIG=" -config-file $(readlink -f ".github/actionlint.yml")" + elif [[ -f ".github/actionlint.yaml" ]]; then + CONFIG=" -config-file $(readlink -f ".github/actionlint.yaml")" else error "Should be unreachable -- previously found a valid local actionlint but cannot find it now..." exit 1