> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qawolf.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How to integrate GitHub/GitHub Actions

> Connect QA Wolf to GitHub Actions to automatically trigger test runs when you deploy code from your repository.

If your repositories are hosted on GitHub.com or GitHub Enterprise Cloud, this is the recommended setup. The integration connects directly to your QA Wolf environments using GitHub Actions to notify QA Wolf of new deployments.

<Tip>
  If your team self-hosts GitHub Enterprise Server without internet access, or has disabled GitHub Actions by policy, use the [QA Wolf CI SDK](/qawolf/Integrate-with-the-QA-Wolf-SDK-2db5b2a994fb8043be61f06f025d9c63) instead.
</Tip>

<Check>
  Make sure you have:

  * Access to your QA Wolf workspace.
  * Admin access to your GitHub repository.
</Check>

## Enable the GitHub integration in QA Wolf

<Steps>
  <Step>
    Open the `Workspace name` dropdown in QA Wolf and click **Workspace Settings**.
  </Step>

  <Step>
    Choose **Integrations** and then click **Enable** next to **GitHub**. This opens GitHub, where you'll be prompted to sign in if you have not already done so.

    <Frame>
      <img src="https://mintcdn.com/qawolf/4XZ5s3xcaUDfoNRS/images/integrating-with-CI-CD/image-2.png?fit=max&auto=format&n=4XZ5s3xcaUDfoNRS&q=85&s=ac836bfb60ea28b1f7052636fd8ea509" alt="" width="2016" height="1612" data-path="images/integrating-with-CI-CD/image-2.png" />
    </Frame>

    <Danger>
      Your user cannot be a member of multiple GitHub orgs.
    </Danger>
  </Step>

  <Step>
    Choose the repositories QA Wolf should access.

    <Frame>
      <img src="https://mintcdn.com/qawolf/4XZ5s3xcaUDfoNRS/images/integrating-with-CI-CD/image-3.png?fit=max&auto=format&n=4XZ5s3xcaUDfoNRS&q=85&s=7c5289e73ef3ea4372bc821f1e3c8daa" alt="" width="586" height="1060" data-path="images/integrating-with-CI-CD/image-3.png" />
    </Frame>
  </Step>

  <Step>
    Click **Install**. Once installed, QA Wolf can create PR comments.
  </Step>
</Steps>

### Find the QAWOLF\_API\_KEY

<Steps>
  <Step>
    Open the `Workspace name` dropdown in QA Wolf and click **Workspace Settings**.

    <Frame>
      <img src="https://mintcdn.com/qawolf/4XZ5s3xcaUDfoNRS/images/integrating-with-CI-CD/image-4.png?fit=max&auto=format&n=4XZ5s3xcaUDfoNRS&q=85&s=6a4d637ae338bee70e31e68aeb0b3a79" alt="" width="2016" height="1612" data-path="images/integrating-with-CI-CD/image-4.png" />
    </Frame>
  </Step>

  <Step>
    Choose **Integrations**.
  </Step>

  <Step>
    Generate your **QAWOLF\_API\_KEY** by clicking the <Icon icon="clipboard" /> icon to the right of **API Key** under **API Access**.
  </Step>
</Steps>

### Add the QAWOLF\_API\_KEY secret

<Steps>
  <Step>
    Return to GitHub, go to your repository's **Settings** tab, click **Secrets and variables**, and then **Actions**.
  </Step>

  <Step>
    Type `QAWOLF_API_KEY` in **Name** and paste your API key into **Secret**.
  </Step>

  <Step>
    Click **Add secret** to save.

    <Frame>
      <img src="https://mintcdn.com/qawolf/4XZ5s3xcaUDfoNRS/images/integrating-with-CI-CD/image-5.png?fit=max&auto=format&n=4XZ5s3xcaUDfoNRS&q=85&s=385d44df64928bf73a276837ed9c6b46" alt="" width="1650" height="1410" data-path="images/integrating-with-CI-CD/image-5.png" />
    </Frame>

    <Note>
      This key allows your workflow to authenticate with QA Wolf when the Action runs.
    </Note>
  </Step>
</Steps>

## Add the GitHub Actions workflow

QA Wolf's official GitHub Action, [Notify QA Wolf on Deploy](https://github.com/marketplace/actions/notify-qa-wolf-on-deploy), notifies QA Wolf whenever a new deployment is ready for testing.

<Danger>
  This must be done for every repository you want connected to CI/CD.
</Danger>

<Steps>
  <Step>
    Open your repository on GitHub. Click the **Actions** tab.

    <Frame>
      <img src="https://mintcdn.com/qawolf/4XZ5s3xcaUDfoNRS/images/integrating-with-CI-CD/image-6.png?fit=max&auto=format&n=4XZ5s3xcaUDfoNRS&q=85&s=855380ad25f17d3062587e103297bb6a" alt="" width="1526" height="114" data-path="images/integrating-with-CI-CD/image-6.png" />
    </Frame>
  </Step>

  <Step>
    If you already have actions, click **New workflow**.

    <Frame>
      <img src="https://mintcdn.com/qawolf/4XZ5s3xcaUDfoNRS/images/integrating-with-CI-CD/image-7.png?fit=max&auto=format&n=4XZ5s3xcaUDfoNRS&q=85&s=2c6f6d70d2ae7d8cd787b7b6e317c1f1" alt="" width="768" height="840" data-path="images/integrating-with-CI-CD/image-7.png" />
    </Frame>
  </Step>

  <Step>
    Choose **Set up a workflow yourself**.

    <Frame>
      <img src="https://mintcdn.com/qawolf/4XZ5s3xcaUDfoNRS/images/integrating-with-CI-CD/image-8.png?fit=max&auto=format&n=4XZ5s3xcaUDfoNRS&q=85&s=a3f0bf8bcb8d2b5eb8b264d40661a0b0" alt="" width="1822" height="530" data-path="images/integrating-with-CI-CD/image-8.png" />
    </Frame>
  </Step>

  <Step>
    Copy the example below into your workflow file (usually `.github/workflows/deploy.yml`). Replace the values in `deployment-type` and `deployment-url` with your actual values.

    To get the value for `deployment-type`, reach out to QA Wolf and we will provide this value for you.

    ```yaml theme={null}
    - name: Notify QA Wolf
      uses: qawolf/notify-qawolf-on-deploy-action@v1
      with:
        qawolf-api-key: ${{ secrets.QAWOLF_API_KEY }}
        deployment-type: "staging"
        deployment-url: "https://staging.example.com"
    ```
  </Step>
</Steps>

## Verify the integration

<Steps>
  <Step>
    Push a new commit to your main branch and wait for your deployment to complete.
  </Step>

  <Step>
    Open QA Wolf and confirm a new run appears under the expected environment.
  </Step>
</Steps>
