[CI] Fix LauchDarkly References Action triggering on forks (#189232)

## Summary

This action is triggering on pushes to `main` on forks as well, this PR
skips the action on forks. The action will fail on the fork and notify
the developer.

### Testing
Failure on my fork's `main` before this PR
1010067456

Tested with this branch in my fork and it skipped properly
96e2ed6e60
1010151467

Flipped the flag to ensure it's working
2a586ccd73
1010153452
This commit is contained in:
Brad White 2024-07-26 11:01:53 -06:00 committed by GitHub
parent 7db28682dd
commit 73cb20d3a4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -13,13 +13,14 @@ concurrency:
jobs:
launchDarklyCodeReferences:
name: LaunchDarkly Code References
if: github.event.repository.fork == false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
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
- name: LaunchDarkly Code References
uses: launchdarkly/find-code-references@v2.12.0
with:
accessToken: ${{ secrets.LD_ACCESS_TOKEN }}
projKey: ${{ secrets.LD_PROJECT_KEY }}
- uses: actions/checkout@v4
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
- name: LaunchDarkly Code References
uses: launchdarkly/find-code-references@v2.12.0
with:
accessToken: ${{ secrets.LD_ACCESS_TOKEN }}
projKey: ${{ secrets.LD_PROJECT_KEY }}