Skip to content

Take the publish branch from the POM, not the workflow - #65

Merged
slachiewicz merged 1 commit into
masterfrom
fix/site-workflow-branch
Aug 8, 2026
Merged

Take the publish branch from the POM, not the workflow#65
slachiewicz merged 1 commit into
masterfrom
fix/site-workflow-branch

Conversation

@slachiewicz

Copy link
Copy Markdown
Member

Found while adding the caller to codehaus-plexus.github.io, which is the one repository that breaks the assumption.

The workflow forces the publish branch:

"-Dscmpublish.scm.branch=gh-pages"

That is correct for project sites. It is wrong for the organisation page: codehaus-plexus.github.io is served from master, not gh-pages

$ gh api repos/codehaus-plexus/codehaus-plexus.github.io/pages
"source": { "branch": "master", "path": "/" }

— and its POM already says so:

<!-- see https://help.github.com/articles/user-organization-and-project-pages/ -->
<scmBranch>master</scmBranch>

The -D would have overridden that and published the main site to a branch nobody serves. The build would have succeeded, so the only symptom would have been the site quietly never updating.

The fix is to stop overriding it. Parent 26 sets <scmBranch>gh-pages</scmBranch> in pluginManagement, so every project site targets exactly what it did before, and the one repository that needs something different already declares it. That is the same principle already applied to content, which the workflow also leaves to the POM.

My mistake in #62 — I generalised from the fourteen project sites and did not check the org page.

The workflow forced -Dscmpublish.scm.branch=gh-pages. That is right for
project sites but wrong for codehaus-plexus.github.io: an organisation
page is served from master, and that repository's POM correctly sets
scmBranch to master. Forcing gh-pages would have overridden it and
published the site to a branch nobody serves - silently, since the
build would have succeeded.

Parent 26 already sets gh-pages in pluginManagement, so every project
site keeps the same target as before and nothing else changes.

Same principle as content, which is also left to the POM.
@slachiewicz slachiewicz added the build Build, CI and release infrastructure label Aug 8, 2026
@slachiewicz
slachiewicz merged commit e8c5615 into master Aug 8, 2026
@slachiewicz
slachiewicz deleted the fix/site-workflow-branch branch August 8, 2026 20:35
slachiewicz added a commit to codehaus-plexus/codehaus-plexus.github.io that referenced this pull request Aug 8, 2026
Calls the shared workflow from codehaus-plexus/.github#62, so the
organisation site can be published from the Actions tab rather than by
a maintainer running 'mvn site-deploy' locally.

This site is served from the master branch, not gh-pages, because it is
an organisation page. That target comes from scmBranch in this POM; the
shared workflow leaves the branch to the POM rather than forcing
gh-pages, which is codehaus-plexus/.github#65.

Part of codehaus-plexus/.github#58
@slachiewicz

Copy link
Copy Markdown
Member Author

Superseded by #66, which is built on top of this.

The premise here was right — the organisation page is served from master, so the workflow must not force gh-pages. But the first real run showed a deeper problem: maven-scm-publish-plugin ignored the pubScmUrl the workflow passed, because the parent POM sets that parameter explicitly in <configuration> and an explicit value always beats a -D user property. So it kept using the ssh URL, which cannot authenticate with the job token — in any repository, not just this one.

#66 pushes with git directly instead. Once the workflow does the push itself it can no longer read scmBranch from the POM, so the branch becomes an explicit publish-branch input, defaulting to gh-pages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Build, CI and release infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant