This GitHub Action is a utility that discovers ConfigCat feature flag and setting usages in your source code and uploads the found code references to ConfigCat.
For more information about repository scanning, see our documentation.
-
Create a new ConfigCat Management API credential and store its values in GitHub Secrets with the following names:
CONFIGCAT_API_USER
,CONFIGCAT_API_PASS
. -
Get the ID of your ConfigCat Config that you want to associate with your repository. The scanner will use this ID to determine which feature flags & settings to search for in your source code.
-
Create a new Actions workflow in your GitHub repository under the
.github/workflows
folder, and put the following snippet into it. Don't forget to replace thePASTE-YOUR-CONFIG-ID-HERE
value with your actual Config ID.on: [push] name: Code references jobs: scan-repo: runs-on: ubuntu-latest name: Scan repository for code references steps: - name: Checkout uses: actions/checkout@v2 - name: Scan & upload uses: configcat/scan-repository@v1 with: api-user: ${{ secrets.CONFIGCAT_API_USER }} api-pass: ${{ secrets.CONFIGCAT_API_PASS }} config-id: PASTE-YOUR-CONFIG-ID-HERE
-
Commit & push your action.
The above example configures a workflow that executes the scan and code references upload on every git push
event.
Scan reports are uploaded for each branch of your repository that triggers the workflow.
Parameter | Description | Required | Default |
---|---|---|---|
api-host |
ConfigCat Management API host. | ☑ | api.configcat.com |
api-user |
ConfigCat Management API basic authentication username. | ☑ | |
api-pass |
ConfigCat Management API basic authentication password. | ☑ | |
config-id |
ID of the ConfigCat config to scan against. | ☑ | |
line-count |
Context line count before and after the reference line. (min: 1, max: 10) | 4 | |
sub-folder |
Sub-folder to scan, relative to the repository root folder. | ||
verbose |
Turns on detailed logging. | false |