---
title: 'GitHub Integration with Test Management by Testsigma'
metadesc: 'Integrate GitHub with TMS by Testsigma to automate test executions & generate test reports through CI/CD pipelines | GitHub Integration with TMS by Testsigma'
canonical: 'https://testsigma.com/docs/test-management/ci-cd-integrations/github/'
page_id: 'github-integration-with-test-management-by-testsigma'
---

# GitHub Integration with Test Management by Testsigma






**Integrate GitHub with Test Management by Testsigma and automate your test runs and generate test reports.**

---

Integrate GitHub with Test Management by Testsigma to automate test executions and generate test reports through CI/CD pipelines. This article discusses integrating GitHub with Test Management by Testsigma.

---

> ## **Prerequisites**
> 
> Before you begin, ensure:
> - You have a **Project** in Test Management by Testsigma and **Test Runs** are available.
> - You have an API token from Test Management by Testsigma.
> - You have a **GitHub** account.



---

## **Configuring the GitHub Actions Workflow**

1. Navigate to your **GitHub** repository. 

2. Open or create the `.github/workflows/tests.yml` file in the root directory.

3. Add the following code into the `tests.yml` file:

    ```yaml
    name: CI Build and Upload to Testsigma

    on:
    push:
        branches:
        - main  # Or your target branch

    jobs:
    build:
        runs-on: ubuntu-latest

        env:
        TESTSIGMA_API_TOKEN: ${{ secrets.TESTSIGMA_API_TOKEN }}

        steps:
        # ✅ Step 1: Check out the code
        - name: 🧾 Check out code
            uses: actions/checkout@v3

        # 🔨 Step 2: Build the project and generate test reports
        - name: 🔨 Build and test with Maven
            run: |
            mvn -B package --file pom.xml

        # 📤 Step 3: Upload test results to Testsigma
        - name: 📤 Upload test results to Testsigma
            run: |
            echo "Uploading JUnit results to Testsigma..."
            curl --location 'https://test-management.testsigma.com/api/v1/projects/{Project_ID}/junit-import/test-run/{Run_ID}' \
                --header "Authorization: Bearer $TESTSIGMA_API_TOKEN" \
                --form "junit_xml=@target/surefire-reports/TEST-MyTests.xml"
    ```

> **NOTE**:
> - Replace `<Project_ID>` in the curl command with your Project ID, which you can retrieve using the Test Management by Testsigma APIs.
> - Replace `<Run_ID>` in the curl command with the Run ID, which is available in the URL when viewing a test run in the format: https://test-management.testsigma.com/ui/test_runs/{Run_ID}/
> - Ensure the path to the JUnit report points to the actual XML file generated by Maven.


---

## **Trigger a Build in GitHub**

1. Push a commit to the **main** (or configured) branch.


2. **GitHub Actions** will run the workflow.


3. After completion, the corresponding test run in Testsigma will be automatically updated with the test execution results.


---