Github Integration

For advanced use cases, you can trigger a test run from your GitHub CI workflow. This will allow you to trigger a run after a successful deployment to staging, production, or another test branch.

1

Configure Secrets

Inside GitHub, add the following values with the correct label as secrets to your repository. Read more about secrets on the GitHub Docs.

Add the following secrets: QATECH_API_TOKEN and QATECH_API_URL

The values to the secrets are found in Congiguration / Integration at QA.tech

2

Create a GitHub Action

Create your Action by creating a new file in your repostory: .github/workflows/trigger-run.yml:


name: 'Trigger QA.tech Run'

on:
  workflow_call:
    secrets:
      url:
        description: 'API URL'
        required: true
      token:
        description: 'API Token'
        required: true

jobs:
  post-request:
    runs-on: ubuntu-latest

    steps:
      - id: 'postRequest'
        uses: fjogeleit/http-request-action@v1
        with:
          url: ${{ secrets.url }}
          method: 'POST'
          bearerToken: ${{ secrets.token }}
          customHeaders: '{"Content-Type": "application/json"}'
          data: '{"trigger": "GITHUB", "actor": "$GITHUB_TRIGGERING_ACTOR", "branch": "$GITHUB_REF", "commitHash": "$GITHUB_SHA", "repository": "$GITHUB_REPOSITORY"}'

      - name: Show response from QA.tech
        run: |
          echo ${{ steps.postRequest.outputs.response }}
3

Use the action in your deployment pipeline

And use it within your existing workflow for deployment:

name: 'Your deployment workflow'
deploy:
  ...your deployment steps
run-qatech:
  needs: deploy
  uses: ./.github/workflows/trigger-run.yml
  secrets:
    url: ${{ secrets.QATECH_API_URL }}
    token: ${{ secrets.QATECH_API_TOKEN }}