fix(ci): publish snapshots to maven.pinont.me repo root - #11
Merged
Conversation
pages-repo.yml never installed singularitylib-processor, so mvn deploy failed on every main push. Install the processor first (same as build.yml), stage processor + lib into a file repo, clone singularity-maven into runner.temp (Maven's target/ is non-empty), and overlay staging onto the gh-pages root that maven.pinont.me already serves — not a /repo/ subfolder — without deleting /javadoc/. Co-authored-by: Nonnipat Tangrojjanakhajorn <contact@pinont.me>
Dispatch run 33554760652 got past processor install, file deploy, and clone; git add/commit succeeded (not safe.directory). git push then failed with exit 128: Invalid username or token for singularity-maven. actions/checkout persist-credentials extraheader injects GITHUB_TOKEN into github.com HTTP, so clone of the public repo succeeds and push uses the wrong credentials. Disable persist-credentials, reset origin to the PAT URL, and blank extraheader on clone/push. Co-authored-by: Nonnipat Tangrojjanakhajorn <contact@pinont.me>
There was a problem hiding this comment.
🟡 Changes recommended
The gh-pages clone fallback can create/publish from the default branch on failure, risking unintended content being pushed to the Pages root.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Updates the publish-public-repo GitHub Actions workflow to correctly publish *-SNAPSHOT artifacts to the root layout served by maven.pinont.me, addressing repeated deployment failures caused by missing local processor installation, incorrect clone destination, incorrect sync path, and credential leakage from actions/checkout.
Changes:
- Installs
singularitylib-processorlocally and file-deploys both processor + library into a staging repository. - Switches gh-pages clone destination to
${{ runner.temp }}and overlays staged Maven paths onto the gh-pages repo root (no/reponesting). - Disables
actions/checkoutcredential persistence and forces PAT-based auth for git operations, with a shared concurrency group to avoid races.
File summaries
| File | Description |
|---|---|
| .github/workflows/pages-repo.yml | Fixes snapshot publishing flow to correctly stage, overlay, and push Maven repository layout to Pinont/singularity-maven gh-pages with correct credentials and concurrency. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+56
to
+60
| git -c "http.https://github.com/.extraheader=" clone --depth 1 --branch gh-pages "$AUTH_URL" "$DEST" || { | ||
| git -c "http.https://github.com/.extraheader=" clone "$AUTH_URL" "$DEST" | ||
| git -C "$DEST" checkout -b gh-pages || true | ||
| } | ||
| git -C "$DEST" remote set-url origin "$AUTH_URL" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
DevTool CI compiles against
https://maven.pinont.meio.github.pinont:singularitylib:2.0.0-SNAPSHOT. Live metadata is stale (lastUpdated20260828180055; jarsingularitylib-2.0.0-20260828.180055-1.jar, 76262 bytes) and is missing APIs now onmain(PaginatedMenu,CommandGroup,Attributes,NmsBridge, …).publish-public-repo(.github/workflows/pages-repo.yml) has failed on everymainpush since. Latest main failure: https://github.com/Pinont/SingularityLib/actions/runs/33210899386 — jobdeploydied at Stage maven repo layout. A dispatch from this branch then failed later: https://github.com/Pinont/SingularityLib/actions/runs/33554760652 — Sync artifacts exit 128.Root cause (verified)
Could not find artifact io.github.pinont:singularitylib-processor:jar:2.0.0-SNAPSHOT.The root pom is a jar (not an aggregator); the processor must be installed locally first, same as
build.yml. Fixed in the first commit; dispatch run 33554760652 confirmed Stage maven repo layout: SUCCESS.mvn deploy, Maven’starget/is non-empty, sogit clone … targetwould fail. Clone into${{ runner.temp }}/singularity-maveninstead.Pinont/singularity-mavengh-pagesalready hasio/(andcom/) at the repo root. Pages source is/with CNAMEmaven.pinont.me. Copy staging onto that root (accumulative), not intorepo/.git add/commitsucceeded ([gh-pages e4b9e49] publish … 33 files changed— notsafe.directory), thengit pushfailed:remote: Invalid username or token. Password authentication is not supported for Git operations.fatal: Authentication failed for 'https://github.com/Pinont/singularity-maven.git/'actions/checkoutpersist-credentials extraheader injectsGITHUB_TOKENinto github.com HTTP. Clone of the public repo still succeeds; push to another repo does not. Fix:persist-credentials: false, resetoriginto the PAT URL, blank extraheader on clone/push.What
Only
.github/workflows/pages-repo.yml:singularitylib-processorbefore deploy (mirrorsbuild.yml).staging/.singularity-mavengh-pagesintorunner.temp, overlaystaging/.onto the clone root./javadoc/,CNAME,.nojekyll, orcom/.persist-credentials: falseon checkout; re-setorigintox-access-token:${MAVEN_REPO_TOKEN}and push with extraheader cleared.singularity-maven-gh-pageswithcancel-in-progress: false.MAVEN_REPO_TOKENandworkflow_dispatchunchanged.Out of scope
main, no tags,release.yml/ Maven Central untouched.publish-public-repo(DevOps will re-dispatch after this push).Verify
mvn deploywithout processor install → same resolution error as run 33210899386.staging/io/github/pinont/{singularitylib,singularitylib-processor}/…(norepo/prefix). Overlay onto a fake gh-pages tree preservedCNAME,.nojekyll,javadoc/, andcom/.workflow_dispatchofpublish-public-repo,https://maven.pinont.me/io/github/pinont/singularitylib/2.0.0-SNAPSHOT/maven-metadata.xmlshould refresh.Note: this PR and #10 both touch
pages-repo.yml. #10 only adds the same concurrency group plus a javadoc comment; this PR already includes those so the remaining #10 hunk is redundant.