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