Repository navigation
v1.1.0: pgrundev/ci-action/database — disposable PostgreSQL for any stack - #3
Merged
Merged
Conversation
A dependency-free Node action (main/post): isolated sanitized or schema-only PGRun branches, DATABASE_URL (and DATABASE_URL_1..N) for the job's later steps, metadata outputs, and deletion of exactly the branches it created when the job ends — on success, failure and cancellation; the branch TTL covers a dead runner. Same gates and token scoping as v1. No framework detection, Ruby, migrations or test execution. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…te or a given-back branch is dropped Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d Go examples; the root action is the Rails preset Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-token refusals on a real runner Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- post acts only on ledgers written with its own token and api-url (a hash, never the token) and calls only its own validated api-url — a ledger a later step rewrites can neither redirect the token nor name other branches - a create is never retried (a lost response would orphan a branch) - a failed main keeps the names it could not delete for post - server text collapsed to one line: no workflow-command injection - atomic ledger writes; sanitized data fails closed without a readable event; a deleted fork is still a fork; env-name reserved list case-insensitive and wider Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Adds
pgrundev/ci-action/database, which provides disposable PostgreSQL for any stack. The action provisions the database, and the customer decides what runs against it.It is a dependency-free Node 24 action using GitHub's
main/postlifecycle (post-if: always()). Its only jobs:sanitized(from the Safe Copy) orschema-only(from a CI template; a CI token never sets the seed). It waits for quota, gives back a partial hold, and never reuses a branch name.DATABASE_URL(andDATABASE_URL_1..N) throughGITHUB_ENV, using a random heredoc delimiter, plus metadata outputs.export-env: falsegives outputs only.There is no framework detection, Ruby, migration or test logic in it. The root action (Rails preset) is unchanged:
action.ymlandlib/are byte-identical to v1.0.0. No server change is needed: the action uses the existingci/context, branches and templates API, with the same CI-token scoping.Docs: the README now leads with the any-stack action;
docs/database.mdholds the full reference plus Rails, Django, Prisma and Go examples (documentation only, no integrations).Acceptance on real GitHub runners (final SHA 5b1d8ce, plus earlier iterations)
DATABASE_URLin a later step, psql connects, data present (6 tables, 117 rows), writes allowedDATABASE_URL_1..3are 3 distinct databases with schema, isolated writesexport-env: false: env unset, outputs workkill -9on Runner.Worker/Listener; no post) → branch removed at its 1h TTLdatabase-guardsjob): sanitized refused; no-token refused; schema-only passes the guardpull_request_targetrefusal are covered by unit testspostgres://,user:password@,pgrun_ci_…)Unit tests:
node --test tests/database.test.js, 17 tests against a stub API (masking, exports, outputs, gates, refusals, quota, SIGINT mid-provisioning, concurrency, planted ledgers, no POST retry).Security review (independent)
apiUrlread back from the ledger, so a later step could redirect the token. Post now uses only its own validatedapi-url, acts only on ledgers carrying its own token+URL hash, and only onci-db-…names.env-namereserved list is case-insensitive and wider.DATABASE_URLis visible to later steps of the job (export-env: falseexists), andapi-urlis author-controlled (documented).Release (not done — needs owner approval)
Merge (rebase) → re-run the acceptance suite on the merged SHA → annotated tag
v1.1.0→ movev1→ GitHub release. Then deploy pgrundev/pgrun#39, which switches the CI page and the CLI page to this workflow.🤖 Generated with Claude Code