Skip to content

fix(release): set gitPublish.username / password from env (real bot user)#25

Merged
musketyr merged 1 commit into
masterfrom
fix/release-gitpublish-credentials
May 22, 2026
Merged

fix(release): set gitPublish.username / password from env (real bot user)#25
musketyr merged 1 commit into
masterfrom
fix/release-gitpublish-credentials

Conversation

@musketyr
Copy link
Copy Markdown
Collaborator

Summary

The 1.0.0.RC2 / RC3 retries reached :guide:gitPublishPush (so PR #23 + PR #24 did clear the previous blockers) but then crashed with:

fatal: could not read Username for 'https://github.com': No such device or address

gradle-git-publish:5.1.2 — pulled in by com.agorapulse.gradle.guide — dropped the legacy GRGIT_USER / GRGIT_PASS env vars and the -Dorg.ajoberstar.grgit.auth.username=... system property the old Kordamp-era workflow relied on. The v5 README is explicit:

If you relied on Grgit's authentication, such as GRGIT_USER, use the new username and password properties on the GitPublication.

This PR applies exactly the fix that landed on micronaut-rethrow at the 3.0.0.RC3 tag (commit 3ee67e9) — that's the rethrow tag that actually released end-to-end:

  • docs/guide/guide.gradle — set credentials on the gitPublish extension directly, reading from GIT_PUBLISH_USERNAME / GIT_PUBLISH_PASSWORD env vars:

    gitPublish {
        username = providers.environmentVariable('GIT_PUBLISH_USERNAME').orElse('')
        password = providers.environmentVariable('GIT_PUBLISH_PASSWORD').orElse('')
    }
  • .github/workflows/release.yml — pass agorapulse-bot as username and the existing AGORAPULSE_BOT_PERSONAL_TOKEN as password (standard GitHub HTTPS basic-auth). Drop the now-useless -Dorg.ajoberstar.grgit.auth.username=… flag. Qualify the task path to :guide:gitPublishPush so the gradle command matches the rethrow exemplar 1:1.

Test plan

  • After merge, recreate the GitHub Release on the existing 1.0.0.RC3 tag (or cut 1.0.0.RC4) so the publishing workflow runs end-to-end.

🤖 Generated with Claude Code

gradle-git-publish 5.x — pulled in by `com.agorapulse.gradle.guide` —
dropped the legacy `GRGIT_USER` / `GRGIT_PASS` env vars and the
`org.ajoberstar.grgit.auth.username` system property the original
Kordamp-era release workflow relied on. Per the v5 README:

> If you relied on Grgit's authentication, such as GRGIT_USER, use the
> new username and password properties on the GitPublication.

This was why the 1.0.0.RC2 / RC3 retries reached `:guide:gitPublishPush`
and crashed with `fatal: could not read Username for 'https://github
.com'`. The git CLI prompts for credentials because no auth has been
plumbed through.

Configure them straight on the gitPublish extension in
docs/guide/guide.gradle, sourcing values from environment variables
that the workflow sets right before the gradle invocation:

    gitPublish {
        username = providers.environmentVariable('GIT_PUBLISH_USERNAME').orElse('')
        password = providers.environmentVariable('GIT_PUBLISH_PASSWORD').orElse('')
    }

release.yml passes the real bot account name (agorapulse-bot) as the
username and the existing AGORAPULSE_BOT_PERSONAL_TOKEN as the
password — standard GitHub HTTPS basic-auth pattern. Drops the
now-useless `-Dorg.ajoberstar.grgit.auth.username` flag and qualifies
the task path to `:guide:gitPublishPush` so it matches the rethrow
exemplar exactly.

This mirrors the fix that landed on micronaut-rethrow at the
3.0.0.RC3 tag (commit 3ee67e9), which is the version that actually
released successfully end-to-end.
@musketyr musketyr merged commit d9d7ddc into master May 22, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant