Skip to content

Commit 7cfb79e

Browse files
committed
Add authenticated ping check after JFrog token exchange
Co-authored-by: Isaac
1 parent 6942745 commit 7cfb79e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

.github/actions/setup-jfrog/action.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,15 @@ runs:
4040
exit 1
4141
fi
4242
43+
# Verify the token works.
44+
HTTP_STATUS=$(curl -sL -o /dev/null -w "%{http_code}" \
45+
-H "Authorization: Bearer ${ACCESS_TOKEN}" \
46+
"https://databricks.jfrog.io/artifactory/api/system/ping")
47+
if [ "$HTTP_STATUS" != "200" ]; then
48+
echo "::error::JFrog auth check failed (HTTP ${HTTP_STATUS})."
49+
exit 1
50+
fi
51+
4352
echo "JFROG_ACCESS_TOKEN=${ACCESS_TOKEN}" >> "$GITHUB_ENV"
4453
4554
- name: Configure Go and Python to use JFrog proxy

0 commit comments

Comments
 (0)