Skip to content

A Release Path for a One-Person SaaS on GitHub Actions: What Environments Can and Can't Enforce

When you're the only developer, GitHub environments can't give you an independent reviewer, and on some plans they can't add approvals or wait timers at all. This article covers what they can enforce, a validation-only sample workflow with mock deploy steps, and a release checklist with a rollback drill.

Checks, Artifact and Release blocks form ascending steps, with a dashed rollback route toward a known-good record.
A synthetic release design separates unprivileged PR checks, mock-artifact checksum consistency and a production gate. Rollback builds an allow-listed ancestor commit; GitHub orchestration and real deployments are untested.
Synthetic mocks; checksum consistency is not provenance. PRs stop after checks; main-only mock release and allow-listed ancestor rollback. GitHub orchestration untested; concurrency is repo-group scoped.

Text equivalent. Solo SaaS releases Teaching diagram • Checks, artifact identity and rollback Push / PR No deploy credentials Checks + build Failure stops release Check mock artifact SHA + listed checksums Production gate Plan / visibility limits PRs stop after checks. Only a push to main uploads the build for mock release. Solo maintainer limits Prevent-self-review can block the sole deployer. A wait timer is a delay, not independent review. Reviewer features depend on plan + visibility. Rollback drill Owner/main dispatch; allow-listed ancestor SHA Build + test old commit > mock redeploy + smoke Repo-group concurrency only; pending runs can replace rollback. Pause releases first. Synthetic mocks; checksum consistency is not provenance. GitHub orchestration untested; concurrency is scoped.

Full-size diagram

A solo founder's release process is often "merge and hope". GitHub Actions can do better than that: tests that block releases, one tested build promoted to production, releases that don't run on top of each other, and a rehearsed way back. But some of the safeguards people expect from GitHub environments don't exist for a team of one, or don't exist on their plan.

This article builds a release path from push to production and is specific about what each gate does and doesn't enforce.

About the examples. The workflows below are a synthetic, validation-only sample. They aren't taken from any client or from this site's repository, and they deploy nothing: the release and rollback jobs are mocks that verify the build artifact and write a deployment record. Here's what was checked locally, with saved output: - actionlint 1.7.12 (with shellcheck 0.11.0 on run: blocks) passes both workflows, and shellcheck passes the helper scripts. - 19 offline tests of the helper scripts pass, and they fail when the checks are replaced with stubs. - Three deliberately broken workflow files are rejected by the linter. Local tests check the helper scripts and artifact checks; lint checks the workflow syntax. GitHub orchestration, environment gates and deployment have not been exercised. Nothing was run on GitHub. Approval, concurrency and artifact behaviour on GitHub is described from GitHub's documentation, not from a test run.

The path

PR ──► test (no secrets, no environment)

push to main ──► test ──► upload tested build + manifest ──► mock-release (environment: production)
                                                                │ verify artifact, record, smoke
mock-rollback (dispatch) ──► validate SHA ──► build + test old commit ──► mock-redeploy
                                                     same concurrency group ┘

Gate 1: pull requests never touch deploy credentials

Pull request code is untrusted, including from your own branches, because it can change any script the workflow runs. In the sample, pull requests run only the test job: no environment, no secrets, a read-only token and persist-credentials: false. GitHub documents that secrets other than GITHUB_TOKEN "are not passed to the runner when a workflow is triggered from a forked repository". That protects you from forks, but not from a same-repository branch, so the boundary has to be in the workflow design.

Two things not to do:

  • Don't give a preview deploy job your deploy token on pull_request. If you need previews, use your hosting platform's own preview integration, or a separately scoped, low-privilege credential with a deliberate trust decision.
  • Don't "fix" fork limits with pull_request_target plus a checkout of the PR code. That runs untrusted code with the base repository's privileges. Pinning third-party actions doesn't make your repository's own scripts safe either.

Gate 2: failing tests stop everything downstream

The release job declares needs: test. GitHub's workflow syntax reference states: "If a job fails or is skipped, all jobs that need it are skipped unless the jobs use a conditional expression that causes the job to continue." Adding always() to a release job's if: breaks this gate.

Gate 3: release the build you tested

A build made in the test job isn't automatically available to another job, because each job runs on a fresh runner. The sample uploads dist/ as an artifact named after the commit, with two files written by write-manifest.sh in the trusted build job: the commit SHA and a SHA-256 checksum of each file present at that point. The release job downloads the artifact by that commit's name, and verify-artifact.sh refuses it unless the recorded SHA string matches and the listed file checksums match the locally generated manifest from the trusted build job. In local tests, a modified file, a wrong SHA and a missing manifest were each refused.

That's a consistency check for a mock demo, not provenance. It doesn't independently establish where the build came from, it doesn't reject extra files that aren't in the manifest, and it can't make a maliciously replaced manifest trustworthy. It isn't a signed attestation. A production replacement should bind an immutable artifact identity and provenance to the release, and enumerate and validate the full permitted file tree.

A token that can do very little. permissions: contents: read sits at the top of both workflows. GitHub documents that once you specify any permission, "all of those that are not specified are set to none", and its secure-use guidance says the GITHUB_TOKEN should be granted "the minimum required" access. Third-party actions are pinned to full commit SHAs. The git ls-remote output for each pin, and a check that every input used exists in that version's action.yml, are saved with the sample (2026-11-07). Re-resolve them before using the sample.

Gate 4: releases don't run on top of each other, within limits

yaml
concurrency:
  group: production
  cancel-in-progress: false

GitHub's concurrency documentation says there "can be at most one running job or workflow in a concurrency group at any time". By default, "any existing pending job or workflow in the same concurrency group will be canceled and the new queued job or workflow will take its place."

That's useful, and narrower than it sounds:

  • It coordinates jobs in this repository's group, nothing else. It doesn't know about a deploy you start by hand from your hosting dashboard, or a provider that keeps deploying asynchronously after your job exits. A real deploy script has to wait for the provider to report completion, and every production path should go through the same group.
  • cancel-in-progress: false stops this policy from cancelling a running job. It doesn't prevent manual cancellation, a timeout or a failure partway through.
  • Pending runs replace each other. A newer push can replace a waiting rollback, or run straight after it and undo it. The sample's release job is skipped when the repository variable RELEASES_PAUSED is true. Set it before a rollback and clear it once production is healthy.

GitHub also documents an optional queue property: single by default, or max for "up to 100 jobs or workflow runs" pending. It notes that combining queue: max with cancel-in-progress: true "is not allowed". actionlint 1.7.12 rejects the queue key. That only shows the linter doesn't know it yet, not whether GitHub accepts it. If you use it, keep a narrowly scoped, documented lint exception and check the behaviour against GitHub's docs. The sample doesn't use it.

The workflow (validation-only; release is a mock)

yaml
name: ci-and-mock-release
on:
  pull_request:          # untrusted code: test only, no environment, no secrets
  push:
    branches: [main]
permissions:
  contents: read
jobs:
  test:
    runs-on: ubuntu-latest
    timeout-minutes: 15
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
        with:
          persist-credentials: false
      - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
        with:
          node-version: 24
          cache: npm
      - run: npm ci
      - run: npm test
      - run: npm run build                       # assumed to write dist/ including dist/index.html
      - run: ./scripts/write-manifest.sh dist "$GITHUB_SHA"
      - if: github.event_name == 'push'
        uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
        with:
          name: build-${{ github.sha }}
          path: dist/
          include-hidden-files: true             # keep the manifest files
          if-no-files-found: error
          retention-days: 30

  mock-release:
    needs: test
    if: github.event_name == 'push' && github.ref == 'refs/heads/main' && vars.RELEASES_PAUSED != 'true'
    runs-on: ubuntu-latest
    timeout-minutes: 10
    environment: production                      # gate point; this mock uses no secrets
    concurrency:
      group: production
      cancel-in-progress: false
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
        with:
          persist-credentials: false
          sparse-checkout: scripts               # trusted scripts from this main commit
      - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
        with:
          name: build-${{ github.sha }}
          path: dist
      - run: ./scripts/mock-deploy.sh dist "$GITHUB_SHA" production > deployment-record.json
      - run: ./scripts/mock-smoke.sh dist deployment-record.json

What the mock scripts stand in for. To turn this into a real release, replace mock-deploy.sh and mock-smoke.sh with scripts that meet this contract:

ScriptMust do
DeployDeploy the artifact whose identity and provenance are bound to this SHA, after validating its full file tree (never rebuild from a different revision). Use a credential scoped to one project, stored as an environment secret. Wait for the provider to report completion, record the provider's deployment ID, and exit nonzero on failure or timeout
Smoke testRequest the deployed URL with a timeout. Check that a real page renders or a health endpoint answers with the expected version. Exit nonzero on failure, not just when the deploy command exited 0

Until you write those, the sample is a mock. Local tests check the helper scripts and artifact checks; lint checks the workflow syntax. GitHub orchestration, environment gates and deployment have not been exercised.

What environments can and can't enforce for a team of one

This is where solo release setups most often overestimate their protection. For the plans and repository types GitHub lists (Free, Pro and Team; Enterprise isn't covered here):

FeaturePublic repo (Free/Pro/Team)Private repo: FreePrivate repo: Pro / Team
Environments, environment secrets, deployment branchesYesNoYes
Required reviewersYesNoNo
Wait timerYesNoNo

GitHub's wording: "For access to environments, environment secrets, and deployment branches in private or internal repositories, you must use GitHub Pro, GitHub Team, or GitHub Enterprise. If you are on a GitHub Free, GitHub Pro, or GitHub Team plan, other deployment protection rules, such as a wait timer or required reviewers, are only available for public repositories."

Even where required reviewers are available, a sole developer runs into another limit. With the option to prevent self-reviews enabled, "users who initiate a deployment cannot approve the deployment job, even if they are a required reviewer". If you're the only person, that blocks your own releases. Leaving it off means the "approval" is you clicking a button for yourself: a useful pause, not an independent review. No configuration creates an independent reviewer. If you want one, a second authorized person with reviewer access can provide it.

A wait timer, where available, is a delay, not a review.

Deployment branch rules protect the workflow run's context, not what it checks out. "Only main can deploy" stops a workflow on another branch from using the environment. It doesn't validate a different commit that a workflow on main checks out. That's why the rollback workflow validates its input itself.

The rollback workflow (validation-only; redeploy is a mock)

yaml
name: mock-rollback
on:
  workflow_dispatch:
    inputs:
      sha:
        description: Full 40-character SHA listed in releases/known-good.txt on main
        required: true
        type: string
permissions:
  contents: read
jobs:
  build-known-good:
    # Run from main only, by the repository owner (suits a user-owned solo repo).
    if: github.ref == 'refs/heads/main' && github.triggering_actor == github.repository_owner
    runs-on: ubuntu-latest
    timeout-minutes: 15
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
        with:
          fetch-depth: 0
          persist-credentials: false
      - name: Validate the requested SHA against main's known-good list
        env:
          REQUESTED_SHA: ${{ inputs.sha }}
        run: ./scripts/validate-rollback-sha.sh "$REQUESTED_SHA" releases/known-good.txt origin/main
      - name: Keep main's scripts, then switch to the known-good commit
        env:
          REQUESTED_SHA: ${{ inputs.sha }}
        run: |
          cp -r scripts "$RUNNER_TEMP/trusted-scripts"
          git checkout --detach "$REQUESTED_SHA"
      - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
        with:
          node-version: 24
          cache: npm
      - run: npm ci
      - run: npm test
      - run: npm run build
      - env:
          REQUESTED_SHA: ${{ inputs.sha }}
        run: '"$RUNNER_TEMP/trusted-scripts/write-manifest.sh" dist "$REQUESTED_SHA"'
      - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
        with:
          name: rollback-${{ github.run_id }}
          path: dist/
          include-hidden-files: true
          if-no-files-found: error
          retention-days: 7

  mock-redeploy:
    needs: build-known-good
    runs-on: ubuntu-latest
    timeout-minutes: 10
    environment: production
    concurrency:
      group: production
      cancel-in-progress: false
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
        with:
          persist-credentials: false
          sparse-checkout: scripts               # main's scripts, not the old commit's
      - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
        with:
          name: rollback-${{ github.run_id }}
          path: dist
      - env:
          REQUESTED_SHA: ${{ inputs.sha }}
        run: ./scripts/mock-deploy.sh dist "$REQUESTED_SHA" production > deployment-record.json
      - run: ./scripts/mock-smoke.sh dist deployment-record.json

The design choices:

  • Not any ref. validate-rollback-sha.sh accepts only a full 40-character SHA that is listed in releases/known-good.txt (a file you update on main after a release is confirmed healthy) and is an ancestor of main. Locally it rejected an unlisted SHA, a listed commit that isn't on main, a short SHA, a branch name, an option-like string, an empty input and the file's comment line.
  • Trusted scripts. The scripts are copied from main before switching to the old commit, and the redeploy job checks out only main's scripts. The old commit is built and tested in a job with no environment and no secrets.
  • The same selected Node major. setup-node selects Node 24 rather than relying on whatever the runner has by default. That's a major-version selection, not an exact immutable toolchain. Exact versions and the build environment need their own pinning policy.
  • The input stays out of shell code. It's passed through environment variables, never interpolated into a run: line. A negative lint file that interpolated github.head_ref into a run: line was flagged by actionlint as potentially untrusted.

Your hosting platform may offer instant rollback to a previous deployment. If it does, that's usually faster, and it should still go through the same pause-releases step.

Code rollback doesn't undo data changes. If a release ran a database migration, redeploying old code against the new schema may fail. Make migrations backward-compatible (add before you remove), or write down the reverse migration before you need it.

The release checklist

  • Pull requests run tests only: no environment, no secrets, persist-credentials: false, no pull_request_target checkout of PR code.
  • permissions: contents: read at workflow level; any write scopes are per job and justified.
  • Release jobs have needs: test and no always().
  • The release deploys the uploaded artifact of the tested SHA, after its checks pass. A production setup binds artifact identity and provenance and validates the full file tree.
  • Release and rollback share one concurrency group. Manual or provider-side deploys are either avoided or coordinated.
  • A RELEASES_PAUSED (or similar) switch exists, and the recovery runbook says when to set and clear it.
  • The production credential is an environment secret, scoped to one project, used only by the release and redeploy jobs.
  • Deployment branch rule limits production to main (if your plan and repository type allow it). Rollback input validation is separate.
  • Third-party actions pinned to full SHAs, re-resolved before use.
  • Deploy and smoke scripts meet the contract above. Migrations reviewed for backward compatibility.

Rollback drill: practise on a staging environment or mock infrastructure first, then decide whether a production drill is worth it.

  1. Note the current production SHA and the last known-good SHA (it must be in known-good.txt).
  2. Set RELEASES_PAUSED=true.
  3. Deploy a harmless visible change (for example a version string) to staging.
  4. Run the rollback with the known-good SHA. Time it.
  5. Confirm the version string reverted and the smoke test passes.
  6. Roll forward, clear RELEASES_PAUSED, and write down how long it took and anything that surprised you.

If you can't do step 4 calmly at 2 a.m., the drill has found what to fix.

SEO output checks belong in an SEO implementation contract. Pre-launch header reviews are in security headers and CSP before launch.

Where this fits

Two client platforms in my portfolio, Flom8 and PropSight, list GitHub Actions CI/CD in their stacks. This article describes a general pattern, not their configurations. SEO output checks and pre-launch header reviews are separate jobs, covered in separate articles.


Want a release path you can trust when you're the only one shipping? It's part of SaaS & Product Engineering. Start here.


Sources

Put the thinking to work

What could this change for you?

Tell me what you’re building — I’ll tell you honestly where I’d start.

Start a project with me