You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14-3Lines changed: 14 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,8 @@
2
2
3
3
This GitHub Action is a utility that automatically populates code references in LaunchDarkly. This is useful for finding references to feature flags in your code, both for reference and for code cleanup.
4
4
5
+
To find code references in pull requests, use [launchdarkly/find-code-references-in-pull-request](https://github.com/launchdarkly/find-code-references-in-pull-request) instead.
6
+
5
7
## Configuration
6
8
7
9
Once you've [created a LaunchDarkly access token](https://docs.launchdarkly.com/home/code/github-actions#prerequisites), store the newly created access token as a repository secret titled `LD_ACCESS_TOKEN`. Under Settings > Secrets in your GitHub repo, you'll see a link to "Add a new secret". Click that and paste in your access token and click "Save secret".
@@ -26,18 +28,26 @@ jobs:
26
28
with:
27
29
fetch-depth: 11# This value must be set if the lookback configuration option is not disabled for find-code-references. Read more: https://github.com/launchdarkly/ld-find-code-refs#searching-for-unused-flags-extinctions
28
30
- name: LaunchDarkly Code References
29
-
uses: launchdarkly/find-code-references@v2.11.10
31
+
uses: launchdarkly/find-code-references@v2.12.0
30
32
with:
31
33
accessToken: ${{ secrets.LD_ACCESS_TOKEN }}
32
34
projKey: LD_PROJECT_KEY
33
35
```
34
36
35
37
We strongly recommend that you update the second `uses` attribute value to reference the latest tag in the [launchdarkly/find-code-references repository](https://github.com/launchdarkly/find-code-references). This will pin your workflow to a particular version of the `launchdarkly/find-code-references` action. Also, make sure to change `projKey` to the key of the LaunchDarkly project associated with this repository.
36
38
37
-
Commit this file under a new branch. Submit as a PR to your code reviewers to be merged into your default branch. You do not need to have this branch merged into the default branch for code references to appear in the LaunchDarkly UI for your flags; code references will appear for this newly created branch.
39
+
Commit this file under a new branch. Submit as a PR to your code reviewers to be merged into your default branch. You do not need to have this new branch merged into the default branch for code references to appear in the LaunchDarkly UI for your flags. Code references appear for this new branch as soon as it is published.
38
40
39
41
As shown in the above example, the workflow should run on the `push` event, and contain an action provided by the [launchdarkly/find-code-references repository](https://github.com/launchdarkly/find-code-references). The `LD_ACCESS_TOKEN` configured in the previous step should be included as a secret, as well as a new environment variable containing your LaunchDarkly project key.
40
42
43
+
## Additional configuration
44
+
45
+
To customize additional configuration not referenced in [Inputs](#inputs), you may use a configuration file located at `.launchdarkly/coderefs.yml`. The following links provide more inforation about configurable options:
The example below is the same as first, but it also excludes any `dependabot` branches. We suggest excluding any automatically generated branches where flags do not change.
43
53
@@ -61,11 +71,12 @@ jobs:
61
71
with:
62
72
fetch-depth: 11 # This value must be set if the lookback configuration option is not disabled for find-code-references. Read more: https://github.com/launchdarkly/ld-find-code-refs#searching-for-unused-flags-extinctions
63
73
- name: LaunchDarkly Code References
64
-
uses: launchdarkly/find-code-references@v2.11.10
74
+
uses: launchdarkly/find-code-references@v2.12.0
65
75
with:
66
76
accessToken: ${{ secrets.LD_ACCESS_TOKEN }}
67
77
projKey: LD_PROJECT_KEY
68
78
```
79
+
69
80
## Troubleshooting
70
81
71
82
Once your workflow has been created, the best way to confirm that the workflow is executing correctly is to create a new pull request with the workflow file and verify that the newly created action succeeds.
0 commit comments