> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/ai-dlc-insights/use-ai-dlc-insights/setup/integrations/github-actions/index.md).

# GitHub Actions

[GitHub Actions](https://docs.github.com/en/actions/learn-github-actions/understanding-github-actions) is a GitHub feature that enables you to automate various event-driven activities in GitHub, such as cloning a repository, generating Docker images, and testing scripts.

Over 10,000 GitHub Actions are available on the [GitHub Marketplace](https://github.com/marketplace?type=actions), and optionally, you can create your own Actions.

You can use the GitHub Action integration to integrate GitHub Actions with Harness SEI.

### Requirements <a href="#requirements" id="requirements"></a>

You can either configure the integration using **Github OAuth** or use a **Github Personal Access Token (PAT)**. If you can't use OAuth, you must create a GitHub personal access token to configure the SEI GitHub Actions integration.

1. Log in to your GitHub account and create a personal access token. For instructions on managing your personal access tokens, see the [official GitHub documentation](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens).
2. Select the following permissions for your personal access token:
   * All repo scopes, including the parent repo scope. The top-level repo scope is required for Harness SEI to have the required visibility into your repos (repoadmin:org -> read:org permission).
   * If your GitHub organization uses SAML SSO, enable SSO for your personal access token. For instructions on authorizing a personal access token for use with SAML SSO, see the [official GitHub documentation](https://docs.github.com/en/enterprise-cloud@latest/authentication/authenticating-with-saml-single-sign-on/authorizing-a-personal-access-token-for-use-with-saml-single-sign-on).

{% hint style="info" %}
If you have enabled an allowlist in your GitHub account, certain Harness IP addresses must be added to it in order to allow communication between the Harness Platform and GitHub. If the necessary IPs are not whitelisted, the integration may fail to authenticate or sync data properly.

To ensure your integration can work correctly, refer to the list of [Harness Platform IPs](/harness-ai/use-harness-platform/references/allowlist-harness-domains-and-ips.md) that may need to be whitelisted in your firewall.
{% endhint %}

### Connect with GitHub Actions (Cloud) <a href="#connect-with-github-actions-cloud" id="connect-with-github-actions-cloud"></a>

1. Select **Integrations** under **Data Settings**.
2. Select **Available Integrations**, locate the **GitHub Actions** integration.
3. Select **Install**.
4. Select the type of the GitHub Actions instance as **Cloud**.

{% tabs %}
{% tab title="Using OAuth" %}

1. Select an authentication method as **Using OAuth**.
2. Follow the prompts to grant access to **GitHub**.
3. In **Integration Name**, enter a name for the integration.
4. Select repositories to associate with the integration or select **Ingest All Repos** to associate all current and future repos in your **GitHub organization**.
5. Click on **Validate Connection** to run the pre-flight checks and validate the connection. Once successful, you'll have the integration set up under the **Your Integrations** tab.
   {% endtab %}

{% tab title="Using Personal Access Token" %}
This authentication method is simple to set up and is suitable for various API interactions. Note that the access token needs periodic renewal based on the timeline of the generated token.

1. In **Integration Name**, enter a **Name** for the integration.
2. Add a **Description** for the integration. (Optional)
3. Enter the **Personal Access Token** that you generated earlier.
4. Click **Validate Connection** to run pre-flight checks and confirm the connection. Once validated, your Github Actions integration will appear under **Your Integrations**.
   {% endtab %}
   {% endtabs %}

### Connect with GitHub Actions (On-Prem) <a href="#connect-with-github-actions-on-prem" id="connect-with-github-actions-on-prem"></a>

To connect Harness SEI with an on-prem instance of GitHub Actions, you'll need to use the [Ingestion Satellite](/software-engineering-insights/use-software-engineering-insights/setup-sei/sei-ingestion-satellite/run-the-satellite-container.md).

The steps for configuring the integration using the **Ingestion Satellite** is similar to configuring the integration on Cloud, with the exception of using satellite to communicate with the GitHub server.

1. In **Integration Name**, enter a **Name** for the integration.
2. Add a **Description** for the integration. (Optional)
3. Enter the **Personal Access Token** that you generated earlier.
4. In the **GitHub Actions URL** field, add the URL where your GitHub Actions instance is hosted.
5. Click on the **Download YAML File** button and save the `satellite.yml` file. Update it following the instructions [here](/software-engineering-insights/use-software-engineering-insights/setup-sei/sei-ingestion-satellite/run-the-satellite-container.md).

If you experience any issues while configuring the integration using the Ingestion Satellite, refer to the [Ingestion Satellite Troubleshooting and FAQs](/software-engineering-insights/use-software-engineering-insights/setup-sei/sei-ingestion-satellite/satellite-troubleshooting-and-faqs.md).

Here’s a sample `satellite.yml` file:

```yaml
satellite:
  tenant: <ACCOUNT_ID>
  api_key: <ACCOUNT_API_KEY>
  url: "https://app.harness.io/gratis/sei/api" 
  # Note that this URL is relative to the Environment of your Harness Account.
  
integrations:
  - id: "<INTEGRATION_ID>"
    application: github_actions
    url: "<GITHUB_INSTANCE_URL>"
    authentication: apikey
```

{% hint style="info" %}
The `Triage Rule` and `Trend` custom fields are not supported as the Stacks and Aggregation option when using the GitHub Actions integration.
{% endhint %}

<details>

<summary>Supported Reports</summary>

Following reports are supported for the GitHub Actions integration:

* CICD Job Count Report
* CICD Job Count Trend Report
* CICD Job Duration Report
* CICD Job Duration Single Stat
* CICD Job Duration Trend Report
* CICD Jobs Count Single Stat
* CICD Pipeline Jobs Count Report
* CICD Pipeline Jobs Count Trend Report
* CICD Pipeline Jobs Duration Report
* CICD Pipeline Jobs Duration Trend Report
* Deployment Frequency - Dora widget
* Change Failure Rate - Dora widget

</details>

### Re-authenticate the GitHub Actions integration <a href="#re-authenticate-the-github-actions-integration" id="re-authenticate-the-github-actions-integration"></a>

The re-authentication steps depend on how your GitHub Actions integration is configured.

#### OAuth (GitHub Cloud) <a href="#oauth-github-cloud" id="oauth-github-cloud"></a>

If you're using OAuth, re-authenticating as an [SEI Admin](/software-engineering-insights/use-software-engineering-insights/get-started/rbac.md#out-of-the-box-roles) refreshes the access token.

1. In GitHub, go to **Settings** → **Applications** → **Authorized OAuth Apps**.
2. Locate the **SEI app**.
3. Revoke access.
4. Return to Harness SEI.
5. Select your GitHub Actions integration.
6. Click **Re-Authenticate** and complete the OAuth flow.

#### Personal Access Token (PAT) <a href="#personal-access-token-pat" id="personal-access-token-pat"></a>

If you're using a PAT:

1. Generate a new PAT with the required scopes.
2. In Harness SEI, go to **Integrations**.
3. Select your GitHub Actions integration.
4. Click **Re-Authenticate**.
5. Enter the new token and validate the connection.

#### On-Prem (Satellite) <a href="#on-prem-satellite" id="on-prem-satellite"></a>

If your GitHub Actions data is ingested via Satellite:

1. Generate a new PAT from your GitHub instance.
2. Ensure the token includes required permissions.
3. Update the credentials in your Satellite configuration if applicable.
4. In Harness SEI, go to **Integrations**.
5. Select your GitHub Actions integration.
6. Click **Re-Authenticate**.
7. Re-authenticate the integration using the updated token.

Re-authentication ensures continued access and resolves issues caused by expired credentials or permission changes.
