<commit_before>---
layout: single
title:  "Configuring GitHub Webhooks"
sidebar:
  nav: setup
---

{% include toc %}

Spinnaker can be configured to listen to changes to a repository in
[GitHub](https://github.com). These steps show you how to configure a GitHub
artifact account so that Spinnaker can download files from GitHub.

## Prerequisites

* You need a [GitHub](https://github.com) account.

### Downloading credentials

Start by generating an [access token](https://github.com/settings/tokens) for
GitHub. Place the token in a file (`$TOKEN_FILE`) readable by Halyard:

```bash
echo $TOKEN > $TOKEN_FILE
```

## Editing Your Artifact Settings

All that's required are the following values:

```bash
# See the prerequisites section above
TOKEN_FILE=

ARTIFACT_ACCOUNT_NAME=my-github-artifact-account
```

First, make sure that artifact support is enabled:

```bash
hal config features edit --artifacts true
```

Next, add an artifact account:

```bash
hal config artifact github account add $ARTIFACT_ACCOUNT_NAME \
    --token-file $TOKEN_FILE
```

There are more options described
[here](/reference/halyard/commands#hal-config-artifact-github-account-edit)
if you need more control over your configuration.
<commit_msg>fix(artifacts): fix github artifact setup (#545)<commit_after>---
layout: single
title:  "Configuring GitHub Webhooks"
sidebar:
  nav: setup
---

{% include toc %}

Spinnaker can be configured to listen to changes to a repository in
[GitHub](https://github.com). These steps show you how to configure a GitHub
artifact account so that Spinnaker can download files from GitHub.

## Prerequisites

* You need a [GitHub](https://github.com) account.

### Downloading credentials

Start by generating an [access token](https://github.com/settings/tokens) for
GitHub. The token requires the __repo__ scope. 

Place the token in a file (`$TOKEN_FILE`) readable by Halyard:

```bash
echo $TOKEN > $TOKEN_FILE
```

## Editing Your Artifact Settings

All that's required are the following values:

```bash
# See the prerequisites section above
TOKEN_FILE=

ARTIFACT_ACCOUNT_NAME=my-github-artifact-account
```

First, make sure that artifact support is enabled:

```bash
hal config features edit --artifacts true
hal config artifact github enable
```

Next, add an artifact account:

```bash
hal config artifact github account add $ARTIFACT_ACCOUNT_NAME \
    --token-file $TOKEN_FILE
```

There are more options described
[here](/reference/halyard/commands#hal-config-artifact-github-account-edit)
if you need more control over your configuration.

{'fraction_non_alphanumeric': 0.09922178988326848, 'fraction_numerical': 0.0011673151750972762, 'mean_word_length': 4.76457399103139, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7359315', 'n_tokens_mistral': 801, 'n_tokens_neox': 735, 'n_words': 290}