# GitHub Actions

This walkthrough shows you how to use CloudTruth parameters safely and securely with GitHub Actions using our [configure-action](https://github.com/marketplace/actions/cloudtruth-configure).

## Prerequisites

* You have a [GitHub account](https://github.com/join).
* You have created one or more [CloudTruth Parameters](/configuration-management/parameters/parameter-management/managing-parameters.md).
* You have created a [CloudTruth API Access token](/configuration-management/integrations.md#api-tokens).

## Update GitHub Repository Secrets

Adding your CloudTruth API access token as a GitHub secret allows GitHub Actions to reference the API token when running a workflow. This allows you to bring configuration and secrets from your CloudTruth projects into GitHub workflows.

In your GitHub repository settings, add a new repository secret with the name `CLOUDTRUTH_TOKEN` that contains your API access token as the value:

![Adding a Repository Secret](/files/n2CnOJdbhRIZePCFcfbY)

### Using [cloudtruth/configure-action](https://github.com/marketplace/actions/cloudtruth-configure)

The [action](https://github.com/marketplace/actions/cloudtruth-configure) can be used to inject the configuration and secrets from a project's environment into your GitHub workflow. Within the same job, steps following the action will have environment variables set to those in your project, based on the environment you choose:

```yaml
---
name: 'demo'
on:
  pull_request: {}

jobs:
  demo:
    runs-on: ubuntu-latest
    steps:
      - uses: cloudtruth/configure-action@v2.0.0
        with:
          apikey: "${{ secrets.CLOUDTRUTH_TOKEN }}"
          project: MyFirstProject
          environment: default
          
      - name: dump the environment
        run: |
          printenv | sort
```

GitHub Action [results](https://github.com/cloudtruth/configure-action/actions/workflows/demo.yml) will show the environment variables that were added to the job, and which parameters were redacted.

{% hint style="info" %}
The output below comes from the configure-action repository and shows a run from parameters that were pre-configured for the configure-action demo script - your output will match the parameters you created.
{% endhint %}

![Example workflow result](/files/-MaccLaRSvos0wnDjqH2)

A complete example is found in the [demo workflow](https://github.com/cloudtruth/configure-action/blob/main/.github/workflows/demo.yml) of the configure-action repository.


---

# 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.cloudtruth.com/configuration-management/integrations/github-actions.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.
