Skip to content

flipt-io/validate-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Flipt Validate Action (Deprecated)

Note

This action is deprecated and will not be maintained going forward. Please use the Flipt Setup Action instead which can be used to validate your feature flag files as well as perform any other operations provided by the Flipt CLI.

GitHub Release

This action validates Flipt feature flag features.yaml files for syntax and semantic errors.

Validate

Example

# testing/features.yaml
namespace: default
flags:
  - key: flipt
    name: flipt
    description: flipt
    enabled: false
    variants:
      - key: flipt
        name: flipt
      - key: flipt
        name: flipt
    rules:
      - segment: internal-users
        rank: 1
        distributions:
          - variant: fromFlipt
            rollout: 110
      - segment: all-users
        rank: 2
        distributions:
          - variant: fromFlipt2
            rollout: 100

Would result in the following output:

Validation failed!

- Message  : flags.0.rules.0.distributions.0.rollout: invalid value 110 (out of bound <=100)
  File     : testing/features.yaml
  Line     : 17
  Column   : 23

Usage

validate:
  runs-on: ubuntu-latest
  steps:
    # Checkout the target repository
    - uses: actions/checkout@v3

    - uses: flipt-io/validate-action@v0.1.0
      # with:
        # Optional, the token to use for GitHub API requests
        # github-token: ${{ secrets.GITHUB_TOKEN }}
        # Optional, the directory to validate, defaults to the repository root
        # working-directory:

Customizing

inputs

Following inputs can be used as step.with keys

Name Type Description
github-token string Optional. The token to use for GitHub API requests
working-directory string Optional. The directory to validate, defaults to the repository root
args string Optional. Additional arguments to pass to the flipt validate command

Development

# Builds the typescript code.
npm run build

# Runs eslint.
npm run lint

# Runs prettier.
npm run format

# Packages the code into the dist folder. Must be updated to pass CI on `main`.
npm run package

# Runs all of the above commands.
npm run all

License

Apache 2.0