Repository navigation
feat: mirror build logs to zitzhen/ZGS-build-log with per-run releases - #7
Merged
Merged
Conversation
Build logs are already archived under /log/<date>-<run-id>/ on the apt repository. This mirrors the same logs into a dedicated repository so they can be browsed and downloaded as git history and as releases: https://github.com/zitzhen/ZGS-build-log/2026-12-01-46640252167/ The new publish-log-repo job maintains that repository: - stage-log-repo.sh writes the run's logs into <date>-<run-id>/ using the same layout as the apt repository. - render-log-readme.sh regenerates the README from the run directories present, so it stays a valid index and adding a run never drops an older one. Entries link to the run directory and to its release. - publish-log-release.sh creates a release tagged <date>-<run-id> with the run's log files attached, published directly rather than as a draft. Re-running is idempotent: an existing release is updated and its assets replaced instead of duplicating them. Commits are authored as zgs-software[bot] <363535165+zgs-software[bot]@users.noreply.github.com> and pushed straight to main, as requested. Authentication uses a GitHub App (app id 6008281, installation 187856393) rather than a long-lived personal token. github-app-token.sh reads the private key from the APP_KEY secret, signs a JWT with iat/exp inside GitHub's accepted window, and exchanges it for an installation token. The token is masked in the log and never persisted: the checkout uses persist-credentials: false, the clone URL is reset to a token-free URL, and the push receives the token as an argument so it cannot end up in .git/config. The job runs in parallel with the R2 publication, so a failure here never blocks an apt release. Tests in script-checks.yml cover the staging layout, the README index listing past runs as well as the current one, rejection of path traversal and malformed run directories, and the fail-closed guards in the token and release scripts. Also verified locally by running the job's own run: blocks under bash, simulating two consecutive publishes against a scratch remote, and confirming the second run leaves the first run's logs and index entry intact. Signed-off-by: Oliver Lin <oliver@liuxiaozhen.dev>
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.
Build logs are already archived under /log/-/ on the apt repository. This mirrors the same logs into a dedicated repository so they can be browsed and downloaded as git history and as releases:
https://github.com/zitzhen/ZGS-build-log/2026-12-01-46640252167/
The new publish-log-repo job maintains that repository:
Commits are authored as zgs-software[bot]
<363535165+zgs-software[bot]@users.noreply.github.com> and pushed straight to main, as requested.
Authentication uses a GitHub App (app id 6008281, installation 187856393) rather than a long-lived personal token. github-app-token.sh reads the private key from the APP_KEY secret, signs a JWT with iat/exp inside GitHub's accepted window, and exchanges it for an installation token. The token is masked in the log and never persisted: the checkout uses persist-credentials: false, the clone URL is reset to a token-free URL, and the push receives the token as an argument so it cannot end up in .git/config. The job runs in parallel with the R2 publication, so a failure here never blocks an apt release.
Tests in script-checks.yml cover the staging layout, the README index listing past runs as well as the current one, rejection of path traversal and malformed run directories, and the fail-closed guards in the token and release scripts. Also verified locally by running the job's own run: blocks under bash, simulating two consecutive publishes against a scratch remote, and confirming the second run leaves the first run's logs and index entry intact.