Home
Softono
feature-flag-pr-insights-action

feature-flag-pr-insights-action

Open source MIT TypeScript
19
Stars
3
Forks
1
Issues
6
Watchers
1 month
Last Commit

About feature-flag-pr-insights-action

DevCycle -

Platforms

Web Self-hosted

Languages

TypeScript

Overview

With this Github action, information on which DevCycle features have been added or removed in a code change will be shown directly on each Pull Request as a comment.

Note: This is intended for pull_request workflow events

Example Output

Example Output

Usage

Create a new Actions workflow in your GitHub repository (e.g. devcycle-insights.yml) in the .github/workflows directory. In your new file, paste the following code:

on: pull_request

jobs:
    dvc-feature-flag-insights:
        runs-on: ubuntu-latest
        name: Generate DevCycle PR Insights
        steps:
            - uses: actions/checkout@v4
              with:
                  fetch-depth: 0
            - uses: DevCycleHQ/[email protected]
              with:
                  # Token generated by GitHub
                  github-token: ${{ secrets.GITHUB_TOKEN }}
                  # Your DevCycle project key
                  project-key: your-project-key
                  # Your organization's DevCycle API client ID & secret
                  client-id: ${{ secrets.DVC_CLIENT_ID }}
                  client-secret: ${{ secrets.DVC_CLIENT_SECRET }}
                  # Only add a comment to the PR if there are changes to DevCycle variables
                  only-comment-on-change: true

We recommend including your DevCycle API credentials and project token as inputs. If included, the PR comment will be enriched with Feature Flag data from DevCycle.

When referencing your API client ID and secret, we recommend using GitHub Secrets to store your credentials securely.

Inputs

input required description
github-token yes The GitHub Actions token e.g. secrets.GITHUB_TOKEN
project-key no Your DevCycle project key, see Projects
client-id no Your organization's API client ID, see Organization Settings
client-secret no Your organization's API client secret, see Organization Settings
only-comment-on-change no If true, comments will only be added to PRs when changes to DevCycle variables are detected. Defaults to false.

Configuration

The patterns used to identify references to variables in your code are fully customizable. This action uses the DevCycle CLI under the hood, for details on how to configure the pattern matcher see the CLI configuration.