Skip to content

Commit 3b1607e

Browse files
[hotfix] Reverse the order of discovery for gh in pipeline (NOAA-EMC#4912)
# [hotfix] gitlab-ci: prefer user-local gh binary over system PATH
1 parent a4b56f6 commit 3b1607e

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

.gitlab-ci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,11 @@ include:
9393
fi
9494
9595
# Setup GitHub CLI for use throughout the pipeline
96-
export GH=$(which gh 2>/dev/null || echo "${HOME}/bin/gh")
96+
if [[ -x "${HOME}/bin/gh" ]]; then
97+
export GH="${HOME}/bin/gh"
98+
else
99+
export GH="$(command -v gh 2>/dev/null)"
100+
fi
97101
if [[ ! -x "${GH}" ]]; then
98102
echo "ERROR: GitHub CLI (gh) not found or not executable. Please install it."
99103
exit 1

0 commit comments

Comments
 (0)