Mode 1 · secrets
Direct secrets
Simplest. The runner receives key material from GitHub Actions Secrets and decrypts directly. Right for solo projects, and for any team already trusting Actions with secrets.
.github/workflows/codeseal-secrets.yml
- uses: actions/checkout@v4
- run: |
curl -fsSL .../install.sh | SGIT_ONLY=1 sh
- name: Build securely
env:
SGIT_KEY: ${{ secrets.SGIT_KEY }}
run: sgit run-secure -- ./build.sh
Mode 2 · portal-key
Portal-delivered key
The runner trades a bootstrap secret for a one-shot token, fetches a wrapped key, and unwraps it locally. Key material exists on the runner for under a second.
.github/workflows/codeseal-portal-key.yml
- run: sgit ci request-token > .ci-token
- run: sgit ci runner-key > runner.wrapped.age
- run: sgit ci unwrap-key -i wrapper.age \
-I runner.wrapped.age -o runner.key
# key gone BEFORE build
- run: rm -f runner.wrapped.age wrapper.age
- run: sgit run-secure -- ./build.sh
Mode 3 · portal-build
Portal-side build
GitHub never sees plaintext. Portal workers clone, decrypt in an isolated sandbox, build, scrub, and hand back artefacts. Strongest isolation; needs a Portal you run.
.github/workflows/codeseal-portal-build.yml
- name: Trigger Portal build
run: |
sgit build trigger \
--commit-sha ${{ github.sha }} \
--repository-id ${{ vars.CODESEAL_REPO_ID }} \
> build.json
- name: Wait for terminal state
run: sgit build status --build-id $ID --wait
Mode 4 · portal-dispatch
Portal-dispatched build
People decrypt locally with their own keys; builds run on Actions. The Portal calls GitHub, never the reverse — so your Portal can sit behind a home router and GitHub never learns where it is.
.github/workflows/codeseal-portal-dispatch.yml
on:
workflow_dispatch:
inputs:
encrypted_token: { required: true }
steps:
- run: echo "::add-mask::$ENCRYPTED_TOKEN"
- run: sgit ci unwrap-dispatch-token
- run: sgit run-secure -- ./build.sh