GitHub Action

The ConfigCat Feature Flag Cleanup for GitHub Actions discovers feature flag usages in your source code and validates them against your feature flags on the ConfigCat Dashboard.

The ConfigCat Feature Flag Reference Validator CLI tool is available as a GitHub Action to integrate with GitHub workflows.

Installation

  1. Get your SDK Key from ConfigCat Dashboard and store it as a GitHub secret under the name CONFIG_CAT_SDK-KEY.

  2. Create a new Actions workflow in your GitHub repo.

    • If you already have an action.yml file: Copy and paste the ConfigCatFeatureFlagCleanup job declaration below into the jobs section in your action.yml file.

    • If you don't already have a workflow file: Create a new file titled action.yml in the .github/workflows directory of your repository. Copy and paste the following code to action.yml.

      on: push
      name: Example Workflow
      jobs:
      ConfigCatFeatureFlagCleanup:
      name: ConfigCat Feature Flag Cleanup
      runs-on: ubuntu-latest
      steps:
      - uses: actions/checkout@v1
      - name: ConfigCat Feature Flag Cleanup
      uses: configcat/github-action-feature-flag-cleanup@1.0.0
      with:
      configcat-sdk-key: ${{ secrets.CONFIG_CAT_SDK-KEY }}
      fail-on-warnings: false
      caution

      We strongly recommend that you update the second uses attribute value to reference the latest tag in the configcat/github-action-feature-flag-cleanup repository. This pins your workflow to a latest version of the action.

  3. Commit & push action.yml.

Usage

Feature Flag Cleanup Action will run on any push event.

Will not block PR approvals until you set fail-on-warnings: true.

Configuration options

Add these to the with section to enable more functionality.

ParameterDescriptionDefault
configcat-sdk-keyThe SDK Key for your feature flags & settings.CONFIG_CAT_SDK-KEY
scan-directoryThe directory to run flag validations on..
configcat-cdn-serverTo set a custom ConfigCat CDN server.cdn.configcat.com
fail-on-warningsShow warnings or stop on a build error when validation fails.false
debugMore verbose logging.false

Documentation

For more information check the ConfigCat's GitHub Action on the GitHub Marketplace.