Skip to main content

Table of Contents

  1. Pre-requisites
  2. GitHub Actions integration
  3. cURL Integration

Pre-requisites

Generate your API Key

Go to the API Keys section and generate a key. You will see something like this once done.

GitHub Actions

Step 1. Go to “Settings” > “Integrations” in your Autonoma dashboard.

Screenshot2025 06 04at5 10 18PM Pn

Step 2. Select the tests or folders that you want to run in your CI, copy the generated action job!

Generate Action Template Gi

Step 3. Add to GitHub Workflow

Copy the action job configuration from the Integrations page and paste it into your GitHub Actions workflow file (.github/workflows/deploy.yml):

Step 4. Set up GitHub Secrets

  1. In your GitHub repository, go to Settings → Secrets and variables → Actions
  2. Add your API credentials as secrets:
    • AUTONOMA_CLIENT_ID: Your client ID from the API Keys section
    • AUTONOMA_CLIENT_SECRET: Your client secret from the API Keys section
deploy.yml
jobs:
  run_autonoma_tests:
    runs-on: ubuntu-latest
    name: Run Autonoma Tests
    
    steps:
      - name: Run Single Test (cmbi807au0172xv01dqu4drhi)
        id: step-1
        uses: autonoma-ai/actions/test-runner@v1
        with:
          test-id: 'cmbi807au0172xv01dqu4drhi'
          client-id: ${{ secrets.AUTONOMA_CLIENT_ID }}
          client-secret: ${{ secrets.AUTONOMA_CLIENT_SECRET }}
          max-wait-time: '10'
      - name: Show cmbi807au0172xv01dqu4drhi results
        if: always()
        run: |
          echo "Test status: ${{ steps.step-1.outputs.final-status }}"
          echo "Message: ${{ steps.step-1.outputs.message }}"
          echo "View results at: ${{ steps.step-1.outputs.url }}"
        

cURL Integration

Step 1. Build the cURL command

curl -X POST
	--silent
	--retry 3 
	--retry-connrefused 
	--location 'https://api.prod.autonoma.app/v1/run/folder/<folder-id>' 
	--header 'autonoma-client-id: <client-id>' 
	--header 'autonoma-client-secret: <client-secret>' 
	--header 'Content-Type: application/json' || true
  • <folder-id> or <test-id>with the actual folder/test ID.
  • <client-id> and <client-secret> with appropriate credentials found in the API Keys section.
You can also find the command by going to a folder, clicking on the three dots and selecting the cURL command option. For a single test its similar, go to a test, click over the three dots and select the cURL command option. Both approaches will display a modal with the cURL command.

Step 2. Add it to your deployment pipeline

Edit your bitbucket-pipelines.yml:
bitbucket-pipelines.yml
pipelines:
  default:
    - step:
        name: Deploy
        script:
          - curl -X POST \
              --silent \
              --retry 3 \
              --retry-connrefused \
              --location "https://api.prod.autonoma.app/v1/run/folder/$FOLDER_ID" \
              --header "autonoma-client-id: $CLIENT_ID" \
              --header "autonoma-client-secret: $CLIENT_SECRET" \
              --header "Content-Type: application/json" || true

👉 Set FOLDER_ID, CLIENT_ID, and CLIENT_SECRET in Bitbucket Repository Variables under Repository settings → Pipelines → Repository variables.
Modify your .gitlab-ci.yml file:
.gitlab-ci.yml
stages:
  - deploy

deploy_job:
  stage: deploy
  script:
    - curl -X POST \
        --silent \
        --retry 3 \
        --retry-connrefused \
        --location "https://api.prod.autonoma.app/v1/run/folder/$FOLDER_ID" \
        --header "autonoma-client-id: $CLIENT_ID" \
        --header "autonoma-client-secret: $CLIENT_SECRET" \
        --header "Content-Type: application/json" || true
  only:
    - main

👉 Set FOLDER_ID, CLIENT_ID, and CLIENT_SECRET as environment variables in GitLab → Settings → CI/CD → Variables.
For a Jenkinsfile, use:
Jenkinsfile
pipeline {
    agent any
    environment {
        FOLDER_ID = credentials('FOLDER_ID')
        CLIENT_ID = credentials('CLIENT_ID')
        CLIENT_SECRET = credentials('CLIENT_SECRET')
    }
    stages {
        stage('Deploy') {
            steps {
                script {
                    sh '''
                    curl -X POST \
                        --silent \
                        --retry 3 \
                        --retry-connrefused \
                        --location "https://api.prod.autonoma.app/v1/run/folder/$FOLDER_ID" \
                        --header "autonoma-client-id: $CLIENT_ID" \
                        --header "autonoma-client-secret: $CLIENT_SECRET" \
                        --header "Content-Type: application/json" || true
                    '''
                }
            }
        }
    }
}

👉 Store FOLDER_ID, CLIENT_ID, and CLIENT_SECRET in Jenkins Credentials under Manage Jenkins → Manage Credentials.
Add the following step in your GitHub Actions workflow (.github/workflows/deploy.yml):
deploy.yml
jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - name: Send cURL POST request
        run: |
          curl -X POST \
              --silent \
              --retry 3 \
              --retry-connrefused \
              --location "https://api.prod.autonoma.app/v1/run/folder/${{ secrets.FOLDER_ID }}" \
              --header "autonoma-client-id: ${{ secrets.CLIENT_ID }}" \
              --header "autonoma-client-secret: ${{ secrets.CLIENT_SECRET }}" \
              --header "Content-Type: application/json" || true

👉 Store FOLDER_ID, CLIENT_ID, and CLIENT_SECRET as GitHub Secrets under Settings → Secrets and variables → Actions.

Best Practices

  • Use environment variables/secrets to avoid exposing credentials.
  • Enable retry logic (--retry 3 --retry-connrefused) for robustness.
  • Use || true to prevent failures from stopping the pipeline.
This ensures your CI/CD pipeline can trigger the API reliably. 🚀
I