VigilQA Docs

GitHub Actions

Trigger VigilQA test runs from GitHub Actions workflows and gate merges on regression results.

Prerequisites

  • A VigilQA project with at least one approved test plan
  • A VigilQA API token (generate from Settings → API Tokens → New Token)
  • The API token stored as a GitHub secret: VIGILQA_API_TOKEN

Basic integration

Add a step to your workflow that triggers a VigilQA run and waits for results:

# .github/workflows/vigilqa.yml
name: VigilQA Tests

on:
  push:
    branches: [main]
  pull_request:

jobs:
  vigilqa:
    runs-on: ubuntu-latest
    steps:
      - name: Trigger VigilQA run
        id: sf_run
        run: |
          RUN_ID=$(curl -s -X POST \
            "https://api.sentinelflux.in/v1/runs" \
            -H "Authorization: Bearer ${{ secrets.VIGILQA_API_TOKEN }}" \
            -H "Content-Type: application/json" \
            -d '{
              "project": "myapp",
              "plan": "regression",
              "context": {
                "commit_sha": "${{ github.sha }}",
                "branch": "${{ github.ref_name }}",
                "pr_number": "${{ github.event.pull_request.number }}"
              }
            }' | jq -r '.run_id')
          echo "run_id=$RUN_ID" >> $GITHUB_OUTPUT

      - name: Wait for results
        run: |
          while true; do
            STATUS=$(curl -s \
              "https://api.sentinelflux.in/v1/runs/${{ steps.sf_run.outputs.run_id }}" \
              -H "Authorization: Bearer ${{ secrets.VIGILQA_API_TOKEN }}" \
              | jq -r '.status')
            if [[ "$STATUS" == "passed" ]]; then exit 0; fi
            if [[ "$STATUS" == "failed" ]]; then exit 1; fi
            if [[ "$STATUS" == "error" ]]; then exit 1; fi
            sleep 15
          done

Gating on regression detection

To fail the workflow only on new regressions (not pre-existing failures), check the regression_guard_status field:

      - name: Check regression guard
        run: |
          RESULT=$(curl -s \
            "https://api.sentinelflux.in/v1/runs/${{ steps.sf_run.outputs.run_id }}" \
            -H "Authorization: Bearer ${{ secrets.VIGILQA_API_TOKEN }}")
          RG_STATUS=$(echo $RESULT | jq -r '.regression_guard_status')
          if [[ "$RG_STATUS" == "regressions_detected" ]]; then
            echo "New regressions detected — failing workflow"
            exit 1
          fi
          echo "No new regressions"

Using the dashboard URL in PR comments

Add the run dashboard URL as a pull request comment for easy access:

      - name: Comment PR with results link
        if: github.event_name == 'pull_request'
        uses: actions/github-script@v7
        with:
          script: |
            const runUrl = `https://app.sentinelflux.in/runs/${{ steps.sf_run.outputs.run_id }}`;
            github.rest.issues.createComment({
              issue_number: context.issue.number,
              owner: context.repo.owner,
              repo: context.repo.repo,
              body: `✅ VigilQA results: ${runUrl}`
            })

Store your project name and plan name as GitHub Actions variables (not secrets) so they are visible in workflow logs and easy to change without modifying the workflow file.

The API token used in CI should have the Engineer role — it only needs to trigger runs and read results. Avoid using an Admin token in CI environments.