# GitHub

## GitHub Artifacts Account <a href="#github-artifacts-account" id="github-artifacts-account"></a>

* Spinnaker can be configured to listen to changes to a repository in GitHub. These steps show you how to configure a GitHub artifact account so that Spinnaker can download files from GitHub.

### Prerequisites <a href="#prerequisites" id="prerequisites"></a>

* It’s mandatory to have a valid GitHub Account.

### Downloading GitHub Credentials: <a href="#downloading-github-credentials" id="downloading-github-credentials"></a>

* Follow the below steps to generate an Access Token for GitHub. Ensure to provide repo scope for the newly created Token.
* Place the token in a file $TOKEN\_File readable by Halyard:

  ```
      echo $TOKEN &gt; $TOKEN_FILE
  ```

### Enable GitHub Artifact Settings <a href="#enable-github-artifact-settings" id="enable-github-artifact-settings"></a>

* Ensure to have the following values enabled

  ```
      # See the prerequisites section above
      TOKEN_FILE=

      ARTIFACT_ACCOUNT_NAME=my-github-artifact-account
  ```
* Ensure to have the GitHub Artifacts Support is enabled on Spinnaker

  ```
      hal config features edit --artifacts true
      hal config artifact github enable
  ```
* Execute the following command to add an Artifact Account

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

**Note**: To Explore more options on this configuration, click [here](https://www.spinnaker.io/reference/halyard/commands/)
