{"id":17753125,"url":"https://github.com/configcat/scan-repository","last_synced_at":"2025-04-01T14:32:08.709Z","repository":{"id":37925499,"uuid":"419404471","full_name":"configcat/scan-repository","owner":"configcat","description":"ConfigCat's repository scanner GitHub Action. ConfigCat is a hosted feature flag service: https://configcat.com. Manage feature toggles across frontend, backend, mobile, desktop apps. Alternative to LaunchDarkly. Management app + feature flag SDKs.","archived":false,"fork":false,"pushed_at":"2024-07-26T10:59:17.000Z","size":110,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-09-26T16:45:17.639Z","etag":null,"topics":["code-analysis","configcat","feature-flag","feature-toggle"],"latest_commit_sha":null,"homepage":"https://configcat.com","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/configcat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-20T16:17:58.000Z","updated_at":"2024-07-25T15:02:03.000Z","dependencies_parsed_at":"2024-01-11T18:23:03.830Z","dependency_job_id":"660bb752-ef09-4f80-8587-e897cdd2c5dc","html_url":"https://github.com/configcat/scan-repository","commit_stats":{"total_commits":34,"total_committers":3,"mean_commits":"11.333333333333334","dds":0.08823529411764708,"last_synced_commit":"5b053c1ec3dcfe0d55e4e393f998529b6d0936c7"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/configcat%2Fscan-repository","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/configcat%2Fscan-repository/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/configcat%2Fscan-repository/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/configcat%2Fscan-repository/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/configcat","download_url":"https://codeload.github.com/configcat/scan-repository/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246604612,"owners_count":20804100,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code-analysis","configcat","feature-flag","feature-toggle"],"created_at":"2024-10-26T13:22:40.207Z","updated_at":"2025-04-01T14:32:08.458Z","avatar_url":"https://github.com/configcat.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ConfigCat Scan Repository \u0026 Feature Flag Sync Action\nThis [GitHub Action](https://github.com/features/actions) helps you get rid of technical debt by scanning the source code and highlighting the feature flag usages for each feature flag on the [ConfigCat Dashboard](https://app.configcat.com).\n\nFor more information about repository scanning, see our [documentation](https://configcat.com/docs/advanced/code-references/overview).\n\n[ConfigCat](https://configcat.com) is a hosted service for feature flag and configuration management. It enables you to decouple feature releases from code deployments.\n\n## Setup\n1. Create a new [ConfigCat Management API credential](https://app.configcat.com/my-account/public-api-credentials) and store its values in [GitHub Secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository) with the following names: `CONFIGCAT_API_USER`, `CONFIGCAT_API_PASS`.\n\n    ![secrets](https://raw.githubusercontent.com/configcat/scan-repository/main/assets/secrets.png  \"secrets\")\n\n2. [Get the ID of your ConfigCat Config](https://configcat.com/docs/advanced/code-references/overview#config-id) that you want to associate with your repository. The scanner will use this ID to determine which feature flags \u0026 settings to search for in your source code.\n\n3. Create a new Actions workflow in your GitHub repository under the `.github/workflows` folder, and put the following snippet into it.\nDon't forget to replace the `PASTE-YOUR-CONFIG-ID-HERE` value with your actual Config ID.\n    ```yaml\n    on: [push]\n    name: Code references\n    jobs:\n      scan-repo:\n        runs-on: ubuntu-latest\n        name: Scan repository for code references\n        steps:\n        - name: Checkout\n          uses: actions/checkout@v4\n        - name: Scan \u0026 upload\n          uses: configcat/scan-repository@v2\n          with:\n            api-user: ${{ secrets.CONFIGCAT_API_USER }}\n            api-pass: ${{ secrets.CONFIGCAT_API_PASS }}\n            config-id: PASTE-YOUR-CONFIG-ID-HERE\n            # line-count: 5             # optional\n            # sub-folder: src           # optional\n            # exclude-keys: \u003e           # optional\n            #   flag_key_to_exclue_1\n            #   flag_key_to_exclue_2\n            # alias-patterns: (\\w+) = :CC_KEY,const (\\w+) = feature_flags\\.enabled\\(:CC_KEY\\) # optional, comma delimited alias patterns\n            # usage-patterns: feature_flags\\.enabled\\(:CC_KEY\\)   # optional, comma delimited flag key usage patterns\n            # verbose: true             # optional\n    ```\n\n4. Commit \u0026 push your action.\n\nThe above example configures a workflow that executes the scan and code references upload on every git `push` event.\nScan reports are uploaded for each branch of your repository that triggers the workflow. \n\n## Available Options\n\n| Parameter        | Description                                                                | Required   | Default             |\n| ---------------- | -------------------------------------------------------------------------- | ---------- | ------------------- |\n| `api-host`       | ConfigCat Management API host.                                             | \u0026#9745;    | `api.configcat.com` |\n| `api-user`       | [ConfigCat Management API basic authentication username](https://app.configcat.com/my-account/public-api-credentials). | \u0026#9745;    |        |\n| `api-pass`       | [ConfigCat Management API basic authentication password](https://app.configcat.com/my-account/public-api-credentials). | \u0026#9745;    |        |\n| `config-id`      | ID of the ConfigCat config to scan against.                                | \u0026#9745;    |                     |\n| `line-count`     | Context line count before and after the reference line. (min: 1, max: 10)  |            | 4                   |\n| `sub-folder`     | Sub-folder to scan, relative to the repository root folder.                |            |                     |\n| `exclude-keys`   | List of feature flag keys that must be excluded from the scan report.      |            |                     |\n| `alias-patterns` | Comma delimited list of custom regex patterns used to search for additional aliases. |  |                     |\n| `usage-patterns` | Comma delimited list of custom regex patterns that describe additional feature flag key usages. |  |                     |\n| `verbose`        | Turns on detailed logging.                                                 |            | false               |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconfigcat%2Fscan-repository","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconfigcat%2Fscan-repository","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconfigcat%2Fscan-repository/lists"}