---
title: "GitHub Actions"
description: "Use Ennote secrets in GitHub Actions: install the Ennote CLI on the runner, authenticate with a token stored as a GitHub secret, and inject secrets into a step with ennote secret get, without writing a .env file."
canonical_url: "https://docs.ennote.io/cli/guides/github-actions"
---
# GitHub Actions

> Use Ennote secrets in GitHub Actions: install the Ennote CLI on the runner, authenticate with a token stored as a GitHub secret, and inject secrets into a step with ennote secret get, without writing a .env file.

## How it works

The workflow installs the Ennote CLI, which reads its token and target from environment variables (`ENNOTE_TOKEN`, `ENNOTE_ORGANIZATION_ID`, `ENNOTE_WORKSPACE_ID`). `ennote secret get <secret> -- <command>` then runs your command with each key of the secret as an environment variable. Nothing is written to disk, and `ennote auth login` is not needed.

## 1. Create a token

Create a [Personal Access Token](https://docs.ennote.io/docs/auth/user-tokens) with an expiration, and copy it.

## 2. Store it in GitHub

In your repository, open **Settings → Secrets and variables → Actions → New repository secret**, name it `ENNOTE_TOKEN` and paste the token.

## 3. Add the workflow

```yaml [.github/workflows/deploy.yml]
name: Deploy

on:
  push:
    branches: [main]

jobs:
  deploy:
    runs-on: ubuntu-latest
    env:
      ENNOTE_TOKEN: ${{ secrets.ENNOTE_TOKEN }}
      ENNOTE_ORGANIZATION_ID: org_123
      ENNOTE_WORKSPACE_ID: wrk_prod
      ENNOTE_DO_NOT_TRACK: 1
    steps:
      - uses: actions/checkout@v4

      - name: Install the Ennote CLI
        run: curl -sSfL https://get.ennote.io/get-cli.sh | sh

      - name: Run database migrations
        run: ennote secret get db-credentials -- npm run migrate

      - name: Deploy
        run: ennote secret get aws -- ./deploy.sh
```

Replace `org_123`, `wrk_prod`, `db-credentials` and `aws` with your organization ID, workspace ID and secret names. `ENNOTE_DO_NOT_TRACK=1` turns off the CLI's telemetry and update checks ([config](https://docs.ennote.io/cli/commands/config)).

## Read a single value

To pass one value to a tool that takes it as an argument, read a single key:

```bash
ennote secret get "database:password"
```

Prefer process injection where you can: a value printed to stdout can end up in logs. See [ennote secret get](https://docs.ennote.io/cli/commands/secret/get) for query formats (`name@version:key`).

## FAQ

### Do I need `ennote auth login` in CI?

No. When `ENNOTE_TOKEN` is set, the CLI uses it instead of the interactive login ([ennote auth](https://docs.ennote.io/cli/commands/auth)).

### Where does the install script put the CLI?

In `/usr/local/bin`, which is on the `PATH` of GitHub-hosted runners. Packages and binaries are also on the [releases page](https://github.com/ennote-io/ennote-cli/releases/latest).

### How do I rotate the token?

Create a new token, update the `ENNOTE_TOKEN` repository secret, then revoke the old token in Ennote ([Personal Access Tokens](https://docs.ennote.io/docs/auth/user-tokens)).

<need-help>



</need-help>


## Sitemap

See the full [sitemap](https://docs.ennote.io/sitemap.md) for all pages.
