Skip to content

Commit bf386c4

Browse files
Merge pull request #52 from Expensify/cole/local-fallback
Fix local actionlint fallback
2 parents cc61963 + c1c9514 commit bf386c4

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

scripts/actionlint.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,16 @@ CONFIG=""
125125
if [[ ! -f "$REPO_ROOT/.github/actionlint.yml" ]] && [[ ! -f "$REPO_ROOT/.github/actionlint.yaml" ]]; then
126126
CONFIG=" -config-file $(readlink -f "$SCRIPT_DIR"/../.github/actionlint.yml)"
127127
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")"
133+
else
134+
error "Should be unreachable -- previously found a valid local actionlint but cannot find it now..."
135+
exit 1
136+
fi
137+
info "Using actionlint file from this repo" >&2
128138
fi
129139

130140
# We can't quote CONFIG here because we need the splitting on spaces for it to be recognized

0 commit comments

Comments
 (0)