# GitHub Action

### Common Build Integration Documentation

This documentation is specific to GitHub. [Common build server](/integrations/build-integrations.md) documentation should be reviewed before proceeding further.&#x20;

### Environment Variables

Environment variable values can be found in your [user profile](/threat-center-1/user-profile.md).

* THREATRIX\_OID - Your organization ID.
* THREATRIX\_EID - Your entityID (if you wish to override your default).
* THREATRIX\_API\_KEY - Personal or organization API key.

### Install Environment Variables as Secrets

{% hint style="warning" %}
This step may require administrative privileges within GitHub
{% endhint %}

1. From within Github, navigate to Organization -> Settings -> Secrest and variables
2. Select "Actions" from the menu
3. Click New organization secret button
4. Set secret name as shown above in Environment Variables
5. From the Repository access drop down, select either "Private Repositories" or "Selected repositories"
6. Click "Add secret"

<figure><img src="/files/IQaHpc0Ag2Ob556AdVdz" alt=""><figcaption></figcaption></figure>

### Add Threat Agent to your GitHub Action script as follows:

```
on:
  pull_request:
    types:
      - 'opened'
      - 'reopened'
  workflow_dispatch:
jobs:
  execute-scan-workflow:
    uses: threatrix/threat-agent-scan/.github/workflows/scan-repo-reusable.yaml@master
    with:
      app-name: YOUR_PROJECT_NAME
      trx-host: https://app.threatrix.io
    secrets:
      TOKEN: ${{ secrets.GITHUB_TOKEN }}
      THREATRIX_EID: ${{ secrets.THREATRIX_EID }}
      THREATRIX_OID: ${{ secrets.THREATRIX_OID }}
      THREATRIX_SERVER_API_KEY: ${{ secrets.THREATRIX_API_KEY }}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.threatrix.io/integrations/build-integrations/github-action.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
