Skip to content

Commit 50e5cb8

Browse files
committed
Add validation for OSSRH credentials in Gradle publish workflow
1 parent 2da33e7 commit 50e5cb8

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

.github/workflows/gradle-publish.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,16 @@ jobs:
8585
8686
echo "Portal deploymentId: $DEPLOY_ID"
8787
88+
if [ -z "$OSSRH_USERNAME" ]; then
89+
echo "::error title='OSSRH_USERNAME' is not set."
90+
exit 1
91+
fi
92+
93+
if [ -z "$OSSRH_TOKEN" ]; then
94+
echo "::error title='OSSRH_TOKEN' is not set."
95+
exit 1
96+
fi
97+
8898
AUTH=$(printf "%s:%s" "$OSSRH_USERNAME" "$OSSRH_TOKEN" | base64)
8999
echo "::add-mask::$AUTH"
90100

0 commit comments

Comments
 (0)