CI/CD
Use the reqlo CLI in scripts and CI: report pending approvals with a project key, and keep decisions with people.
Run policy checks on every pull request, publish on merge, and report approvals that are waiting.
Test policies on pull requests
validate and test run offline with the same engine as the API, so they need no secrets:
name: Policies
on:
pull_request:
push:
branches: [main]
permissions:
contents: read
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: 22 }
- run: npx @reqlo/cli@0.3 policies validate
- run: npx @reqlo/cli@0.3 policies test
publish:
if: github.event_name == 'push'
needs: check
runs-on: ubuntu-latest
env:
REQLO_ACCESS_TOKEN: ${{ secrets.REQLO_ACCESS_TOKEN }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: 22 }
- run: npx @reqlo/cli@0.3 schema push --yes
- run: npx @reqlo/cli@0.3 policies push --publish --yesPublishing needs an owner's or admin's CLI token: run reqlo login as that person, then store the token value
from ~/.config/reqlo/credentials.json as the REQLO_ACCESS_TOKEN secret. The environment comes from
reqlo.config.yaml in the repository. If a publish goes wrong, run reqlo policies rollback <version>.
Report pending approvals
Reading approvals needs only a project API key, so a scheduled job can surface requests that are waiting:
name: Pending ReQlo approvals
on:
schedule:
- cron: "0 * * * *"
permissions:
contents: read
jobs:
report:
runs-on: ubuntu-latest
env:
REQLO_API_KEY: ${{ secrets.REQLO_SANDBOX_API_KEY }}
steps:
- uses: actions/setup-node@v4
with: { node-version: 22 }
- run: npx @reqlo/cli@0.3 approvals list --status pending --json > pending.json
- run: node -e "const n=require('./pending.json').length; console.log(n + ' pending'); if (n) process.exitCode = 1"The second step fails the job when anything is waiting, so it shows up in your checks. Pin the CLI version
(@0.3) so a new release can't change behavior under you.
Keep approval decisions with people
Approving in CI is possible with REQLO_ACCESS_TOKEN and --yes, but it usually defeats the point of an approval:
a rule that requires sign-off should be decided by someone who looked at the request.
If you do automate a decision:
- Use a token created by
reqlo loginfor a dedicated person, never a shared account. Every decision is recorded as that person. - Store the token in your CI secret store, scoped to the job that needs it, and revoke it in Account → CLI tokens when it's no longer used.
- Prefer
rejectfor automated cleanup. A rejection can only stop an action; an approval lets one run.
Credential rules
- A project API key can read approvals but can never approve or reject them.
- Never echo keys or tokens in logs. The CLI keeps them out of its output and errors; your scripts must too.
- Keys and tokens belong in a secret store, never in the repository.
Something wrong or unclear? Report an issue with this page.