Skip to content

Latest commit

 

History

History

examples

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

DiffPal Examples

Use these examples as copy-paste starting points. Pick one provider recipe and one CI system, or adapt the generic ACP template for your own CLI.

The examples pin npm package versions so credentialed CI jobs do not execute newly published package versions automatically. Update @diffpal/diffpal, diffpal-version, @openai/codex, @normahq/codex-acp-bridge, and @github/copilot intentionally after testing. If you use OpenCode, pin the OpenCode package or install source in your own CI setup the same way.

Get Started Fast

Scenario Start here
GitHub Actions with Codex API key configs/codex-api-key/config.yaml + ci/github-actions/codex-api-key.yml
GitHub Actions with Codex subscription auth configs/codex-subscription/config.yaml + ci/github-actions/codex-subscription.yml
GitHub Actions with Copilot token configs/copilot-github-token/config.yaml + ci/github-actions/copilot-github-token.yml

For the full first-run path, use the quickstart. Before enabling any secret-backed example, read Secrets and fork PRs.

Bring Your Own Agent

Setup Config CI secret
ACP Registry agent configs/acp-registry/config.yaml selected-agent-specific
Generic ACP CLI configs/generic-acp/config.yaml provider-specific
OpenCode ACP configs/opencode-acp/config.yaml OpenCode-specific

Copy the selected config to .config/diffpal/config.yaml. For an official registry entry, replace registry_acp.registry_id with the agent you evaluated. For another ACP CLI, start from the generic ACP config and replace generic_acp.cmd with the command that starts its ACP stdio server.

Govern Review Quality

Use these references when you want stricter policy, auditing, or rollout control:

  • Providers for runtime.providers, install, authentication, and provider-specific failure checks
  • Config reference for review instructions, MCP servers, profiles, and gate.block_on
  • Findings schema for the structured bundle
  • Verify First Review for expected summary, comments, artifacts, and gate behavior

Compare Publish Surfaces

CI system Codex API key Codex subscription Copilot token
GitHub Actions ci/github-actions/codex-api-key.yml ci/github-actions/codex-subscription.yml ci/github-actions/copilot-github-token.yml
GitLab CI ci/gitlab/codex-api-key.yml ci/gitlab/codex-subscription.yml ci/gitlab/copilot-github-token.yml
Azure Pipelines ci/azure-pipelines/codex-api-key.yml ci/azure-pipelines/codex-subscription.yml ci/azure-pipelines/copilot-github-token.yml

Auth Notes

Use Providers for provider-specific install and authentication. The examples below keep provider install/auth commands only where they are part of a complete copy-paste CI file.

  • The GitLab examples restrict secret-backed jobs to same-project merge requests, require a protected DIFFPAL_TRUSTED_REVIEW=true variable, and run as manual jobs so maintainers decide when provider credentials are exposed.
  • The Azure examples skip credentialed review steps when System.PullRequest.IsFork is True.

Generate CODEX_AUTH_JSON_B64

Use this only when you intentionally want Codex subscription auth in trusted CI. API-key auth is simpler to rotate and should remain the default automation path.

This command creates a fresh file-backed Codex login in a temporary CODEX_HOME, then base64-encodes the generated auth.json for the CODEX_AUTH_JSON_B64 secret:

npm install --global @openai/[email protected]

tmp_codex_home="$(mktemp -d)"
trap 'rm -rf "$tmp_codex_home"' EXIT

printf '%s\n' 'cli_auth_credentials_store = "file"' > "$tmp_codex_home/config.toml"
CODEX_HOME="$tmp_codex_home" codex login --device-auth

test -s "$tmp_codex_home/auth.json"
codex_auth_json_b64="$(base64 < "$tmp_codex_home/auth.json" | tr -d '\n')"

gh secret set CODEX_AUTH_JSON_B64 --body "$codex_auth_json_b64"

For GitLab or Azure Pipelines, store the value of codex_auth_json_b64 as a masked/protected CODEX_AUTH_JSON_B64 CI secret or pipeline variable.

Treat auth.json and CODEX_AUTH_JSON_B64 like passwords. They contain access tokens. Do not commit them, paste them into issues, or expose them to fork PR/MR jobs.