Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/flipt-io/setup-action

Install Flipt CLI in your GitHub Workflows
https://github.com/flipt-io/setup-action

cd ci continuous-deployment continuous-integration feature-flags

Last synced: about 2 months ago
JSON representation

Install Flipt CLI in your GitHub Workflows

Awesome Lists containing this project

README

        

# Flipt Setup Action

![GitHub Release](https://img.shields.io/github/v/release/flipt-io/setup-action)

This action installs [Flipt](https://flipt.io) in your GitHub Actions workflow.

You can pass additional arguments to the `flipt` command using the `args` input. If no arguments are provided, `flipt` will be installed and run with the `--help` flag.

Any of the [Flipt CLI commands](https://www.flipt.io/docs/cli/overview) can be run using this action.

## Examples

### Validate

Docs:

This example installs Flipt and runs `flipt validate` against the repository root.

```yaml
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: flipt-io/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # required to download flipt cli without rate limiting
# Optional, additional arguments to pass to the `flipt` command
# args:
# Optional, the version of Flipt to install, defaults to the latest release
# version:
# Optional, the directory to run Flipt against, defaults to the repository root
# working-directory:

- run: flipt validate
```

### OCI Bundle and Push

Docs:

This example installs Flipt and runs `flipt bundle build` against the repository root. It then pushes the bundle to a registry with `flipt bundle push`, allowing you to store and share your feature flag data as an OCI artifact.

```yaml
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: flipt-io/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # required to download flipt cli without rate limiting
# Optional, additional arguments to pass to the `flipt` command
# args:
# Optional, the version of Flipt to install, defaults to the latest release
# version:
# Optional, the directory to run Flipt against, defaults to the repository root
# working-directory:

- name: Get UUID
id: uuid
run: |
echo "uuid=$(uuidgen)" >> $GITHUB_OUTPUT

# Build the bundle and push it to an ephemeral registry (available for 1 hour)
- name: Build and Push bundle
run: |
flipt bundle build {{ steps.uuid.outputs.uuid }}:latest ttl.sh/${{ steps.uuid.outputs.uuid }}:1h
flipt bundle push ttl.sh/${{ steps.uuid.outputs.uuid }}:1h
```

## Customizing

### inputs

Following inputs can be used as `step.with` keys

| Name | Type | Description |
| ------------------- | ------ | -------------------------------------------------------------------------- |
| `working-directory` | string | **Optional**. The directory to validate, defaults to the repository root |
| `version` | string | **Optional**. The version of Flipt to install, defaults to the latest release. |
| `args` | string | **Optional**. Additional arguments to pass to the `flipt` command |
| `GITHUB_TOKEN` | string | **Required**. The GitHub token to use to download Flipt CLI without rate limiting. |

## Development

```console
# 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](LICENSE)