-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
37 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,20 +12,24 @@ Next, create a new Actions workflow in your selected GitHub repository (e.g. `co | |
|
||
```yaml | ||
on: push | ||
name: Example Workflow | ||
name: Find LaunchDarkly flag code references | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
launchDarklyCodeReferences: | ||
name: LaunchDarkly Code References | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
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 | ||
fetch-depth: 10 # 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 | ||
- name: LaunchDarkly Code References | ||
uses: launchdarkly/[email protected].0 | ||
uses: launchdarkly/[email protected].4 | ||
with: | ||
accessToken: ${{ secrets.LD_ACCESS_TOKEN }} | ||
projKey: YOUR_PROJECT_KEY | ||
projKey: LD_PROJECT_KEY | ||
``` | ||
|
||
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. | ||
|
@@ -34,6 +38,34 @@ Commit this file under a new branch. Submit as a PR to your code reviewers to b | |
|
||
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. | ||
|
||
## Additional Examples | ||
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. | ||
|
||
```yaml | ||
on: | ||
push: | ||
branches-ignore: | ||
- 'dependabot/**' | ||
|
||
name: Find LaunchDarkly flag code references | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
launchDarklyCodeReferences: | ||
name: LaunchDarkly Code References | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 10 # 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 | ||
- name: LaunchDarkly Code References | ||
uses: launchdarkly/[email protected] | ||
with: | ||
accessToken: ${{ secrets.LD_ACCESS_TOKEN }} | ||
projKey: LD_PROJECT_KEY | ||
``` | ||
## Troubleshooting | ||
|
||
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. | ||
|