Skip to content

Latest commit

 

History

History
59 lines (38 loc) · 2.39 KB

DEVELOPMENT.md

File metadata and controls

59 lines (38 loc) · 2.39 KB

Development

Getting started

  1. Install and configure pre-commit for the repository
  2. Install Node 20
  3. Install dependencies
    npm i
    
  4. Install nektos/act for testing
  5. Copy a valid environment SDK key for testing locally
  6. Configure the required flags as detailed below.

Flag configurations

In order to evaluate the test workflows successfully, your test environment must have the following flag configurations.

test-number-flag is a numeric flag that evaluates to 1 when on and 0 when off. No targeting rules should be provided.

test-boolean-flag is a boolean flag that evaluates to true when on and false when off. No targeting rules should be provided.

test-json-flag is a JSON flag that evaluates to {"pet": "cat"} when on and {"pet": "dog"} when off. No targeting rules should be provided.

test-string-flag is a string flag that should evaluate to "fallthrough" when on and "off" when "off". It should also have the below targeting rules:

  1. A context kind of GithubCustomAttributes and a key of context-key should return custom.
  2. A context kind of GithubCustomAttributes and a key of ld-github-action-flags should return custom.
  3. A context kind of GithubCustomAttributes and a group of beta should return custom.
  4. A context kind of GitHubRunner and a RUNNER_TAG of GitHub Actions should return runner.
  5. A context kind of GitHub with any GITHUB_ACTOR set should return github.

Build instructions

The action is built using @vercel/ncc.

npm run build

Testing locally

Use nektos/act to run actions locally. The RUNNER_TRACKING_ID environment variable will not be available automatically, preventing GitHubRunner related tests from passing. We must set it manually as shown below.

act --env RUNNER_TRACKING_ID=1 -s SDK_KEY=<SDK-KEY>

Read more: Example commands

Publishing a release

Follow instructions to publish a release to the GitHub Marketplace.

Publishing is a manual step even if automation is used to create a release.

Versioning

Read more: Semantic versioning