Skip to content

ci: push personal staging refs with PAT - #15

Merged
btli merged 3 commits into
mainfrom
ci/staging-push-pat
Aug 14, 2026
Merged

ci: push personal staging refs with PAT#15
btli merged 3 commits into
mainfrom
ci/staging-push-pat

Conversation

@btli

@btli btli commented Aug 13, 2026

Copy link
Copy Markdown
Owner

Related issue

N/A — fork-only CI maintenance.

Summary

  • Use STAGING_PUSH_TOKEN for checkout credentials in trusted personal-staging jobs that push Git refs, falling back to github.token when the secret is unset.
  • Keep test-composer, Android build code, and GHCR image publishing outside the PAT trust boundary.

Test Plan

  • python3 -c "import yaml,glob; [yaml.safe_load(open(f)) for f in glob.glob('.github/workflows/personal-staging*.yml')]"
  • uv run --frozen --extra dev python -m pytest .github/scripts/personal-staging/
  • Confirmed uv.lock SHA-256 was unchanged before and after the frozen test run.
  • Reviewed the final diff to confirm only the two Git-ref-pushing workflow files changed.

Demo

N/A — non-visual CI change.

Type of change

  • Bug fix
  • Feature
  • UI / frontend change
  • Refactor / chore
  • Docs
  • Test / CI
  • Breaking change

Test coverage

  • Unit tests added / updated
  • Integration tests added / updated
  • E2E tests added / updated
  • Manual verification completed
  • Existing tests cover this change
  • Not applicable

Coverage notes

Manually verified all personal-staging workflow YAML parses successfully and the untouched staging composer suite passes all 47 tests under uv --frozen. No tests changed because this is a checkout credential wiring change.

Changelog

N/A — internal fork CI maintenance.


Secret-scoping audit (tribunal r3 MEDIUM — resolved by verification, 2026-08-13)

Verified via API by the orchestrator before merge:

  • No repository-level secrets exist on btli/omnigent — in particular no repo-level STAGING_PUSH_TOKEN copy (the r2 exfiltration path is closed).
  • Environment staging-push exists with deployment branch policy selected branches: main (branch type, no tag patterns).
  • The environment holds no secret yet: the || github.token fallback is active, byte-identical to pre-PR behavior. When minting the PAT (Contents+Workflows RW, btli/omnigent only), store it only as an environment secret at Settings → Environments → staging-push → STAGING_PUSH_TOKEN. Never as a repo-level secret.
  • ⚠️ Invariant to maintain: if the staging-push environment is ever deleted, GitHub auto-recreates it on next run without protection rules — recreate the main-only branch policy immediately.

Use the workflows-scoped staging PAT for trusted checkout credentials while retaining the default GitHub token fallback when the secret is absent.

Signed-off-by: Bryan Li <bryan.li@gmail.com>
Co-authored-by: omnigent <noreply@omnigent.ai>
@github-actions github-actions Bot added the size/S Pull request size: S label Aug 13, 2026
btli and others added 2 commits August 13, 2026 10:25
Use the PAT for the floating nightly ref update, suppress automation-triggered push fan-out, and guard nightly main synchronization against non-main dispatches.

Signed-off-by: Bryan Li <bryan.li@gmail.com>
Co-authored-by: omnigent <noreply@omnigent.ai>
Preserve GitHub token fallback merge behavior, force skip-marked merge commits only for PAT pushes, and restrict PAT-bearing jobs to the staging-push environment.

Signed-off-by: Bryan Li <bryan.li@gmail.com>
Co-authored-by: omnigent <noreply@omnigent.ai>
@btli
btli merged commit dfd36fa into main Aug 14, 2026
54 of 56 checks passed
@btli
btli deleted the ci/staging-push-pat branch August 14, 2026 00:25
btli pushed a commit that referenced this pull request Aug 14, 2026
Squash of the fork's staging automation onto upstream main: the hourly/
nightly/images workflows and the stage.py composer with its tests and
docs, including the STAGING_PUSH_TOKEN environment fallback (PR #15)
and branch: extras pins (PR #16), with homelab pinned. Full prior
history preserved at tag archive/main-2026-08-14.

Signed-off-by: Bryan Li <bryan.li@databricks.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S Pull request size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant