Skip to content

Commit 4afdd95

Browse files
authored
Merge pull request #53 from Expensify/claude-fixActionlintConfigPath
Fix actionlint config path resolution after cd into REPO_ROOT
2 parents bf386c4 + f0dac94 commit 4afdd95

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

scripts/actionlint.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,16 @@ echo
121121
cd "$REPO_ROOT" || exit 1
122122

123123
# If a repo has it's own action lint config, use that. Otherwise, use the one in this repo.
124+
# Note: we've already cd'd into $REPO_ROOT above, so use paths relative to cwd.
124125
CONFIG=""
125-
if [[ ! -f "$REPO_ROOT/.github/actionlint.yml" ]] && [[ ! -f "$REPO_ROOT/.github/actionlint.yaml" ]]; then
126+
if [[ ! -f ".github/actionlint.yml" ]] && [[ ! -f ".github/actionlint.yaml" ]]; then
126127
CONFIG=" -config-file $(readlink -f "$SCRIPT_DIR"/../.github/actionlint.yml)"
127128
info "Using default Github-Actions repo actionlint.yml" >&2
128-
else
129-
if [[ -f "$REPO_ROOT/.github/actionlint.yml" ]]; then
130-
CONFIG=" -config-file $(readlink -f "$REPO_ROOT/.github/actionlint.yml")"
131-
elif [[ -f "$REPO_ROOT/.github/actionlint.yaml" ]]; then
132-
CONFIG=" -config-file $(readlink -f "$REPO_ROOT/.github/actionlint.yaml")"
129+
else
130+
if [[ -f ".github/actionlint.yml" ]]; then
131+
CONFIG=" -config-file $(readlink -f ".github/actionlint.yml")"
132+
elif [[ -f ".github/actionlint.yaml" ]]; then
133+
CONFIG=" -config-file $(readlink -f ".github/actionlint.yaml")"
133134
else
134135
error "Should be unreachable -- previously found a valid local actionlint but cannot find it now..."
135136
exit 1

0 commit comments

Comments
 (0)