Skip to content

Commit 26a4183

Browse files
committed
Issue #156 fix Central publish 401 in release workflow
actions/setup-java's server-username/server-password/gpg-passphrase inputs take environment variable NAMES, not secret values. Passing the values directly left settings.xml with empty credentials, so the Sonatype Central upload failed with 401 on every release tag since 0.1.8. Provide the values via the step env block and reference the names instead.
1 parent 4c05919 commit 26a4183

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

‎.github/workflows/release-on-tag.yml‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,16 @@ jobs:
3030
java-version: '21'
3131
cache: maven
3232
server-id: central
33-
server-username: ${{ secrets.CENTRAL_USERNAME }}
34-
server-password: ${{ secrets.CENTRAL_PASSWORD }}
33+
# setup-java expects ENVIRONMENT VARIABLE NAMES here, not values;
34+
# the values are provided via the env block below (issue #156).
35+
server-username: CENTRAL_USERNAME
36+
server-password: CENTRAL_PASSWORD
3537
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
36-
gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }}
38+
gpg-passphrase: GPG_PASSPHRASE
39+
env:
40+
CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
41+
CENTRAL_PASSWORD: ${{ secrets.CENTRAL_PASSWORD }}
42+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
3743

3844
- name: Extract version from tag
3945
id: version

0 commit comments

Comments
 (0)