Skip to main content
Version: Config V2

Evaluate feature flags in GitHub Actions

ConfigCat's CLI GitHub Actions has the ability to evaluate feature flags in GitHub Action workflows. This feature lets you use your feature flag values or create conditional steps in your workflow.

Prerequisites

  • An SDK key for the ConfigCat config/environment pair that contains the feature flags you want to evaluate.

Example

The following example shows how you can evaluate ConfigCat feature flags and use the evaluated results in subsequent steps.

name: Evaluate ConfigCat feature flags
on: push
jobs:
example-job:
runs-on: ubuntu-latest
steps:
- name: Evaluate feature flags
id: flags
uses: configcat/cli-actions/eval-flag@v1
with:
sdk-key: ${{ secrets.CONFIGCAT_SDK_KEY }}
flag-keys: |
flag1
flag2
user-attributes: |
id:1234

- name: Step depending on flag1
if: steps.flags.outputs.flag1 == 'true'
run: echo "flag1 is true"

- name: Step depending on flag2
if: steps.flags.outputs.flag2 == 'true'
run: echo "flag2 is true"

The results of the flag evaluations are stored in the step outputs named with each flag's key.

Available Options

ParameterDescriptionRequiredDefault
sdk-keySDK key identifying the config to download, also loaded from the CONFIGCAT_SDK_KEY environment variable
flag-keysList of feature flag keys to evaluate. Multiple values must be in separate lines.
user-attributesList of user attributes used for evaluation. Multiple values must be in separate lines in the following format: <key>:<value>. Dedicated User Object attributes are mapped like the following: Identifier => id, Email => email, Country => country.
base-urlThe CDN base url from where the CLI will download the config JSON.ConfigCat CDN servers.
data-governanceDescribes the location of your feature flag and setting data within the ConfigCat CDN. Possible values: eu, global.global
verboseTurns on detailed logging.false