You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
60 lines
1.7 KiB
60 lines
1.7 KiB
name: Collect code references |
|
|
|
on: |
|
push: |
|
concurrency: |
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |
|
cancel-in-progress: true |
|
|
|
jobs: |
|
check-ld-secret: |
|
name: Check for LD secret |
|
runs-on: ubuntu-22.04 |
|
outputs: |
|
available: ${{ steps.check-ld-secret.outputs.available }} |
|
permissions: |
|
contents: read |
|
|
|
steps: |
|
- name: Check |
|
id: check-ld-secret |
|
run: | |
|
if [ "${{ secrets.LD_ACCESS_TOKEN }}" != '' ]; then |
|
echo "available=true" >> $GITHUB_OUTPUT; |
|
else |
|
echo "available=false" >> $GITHUB_OUTPUT; |
|
fi |
|
|
|
refs: |
|
name: Code reference collection |
|
runs-on: ubuntu-22.04 |
|
needs: check-ld-secret |
|
if: ${{ needs.check-ld-secret.outputs.available == 'true' }} |
|
permissions: |
|
contents: read |
|
pull-requests: write |
|
|
|
steps: |
|
- name: Check out repository |
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
|
|
|
- name: Collect |
|
id: collect |
|
uses: launchdarkly/find-code-references@e3e9da201b87ada54eb4c550c14fb783385c5c8a # v2.13.0 |
|
with: |
|
accessToken: ${{ secrets.LD_ACCESS_TOKEN }} |
|
projKey: default |
|
|
|
- name: Add label |
|
if: steps.collect.outputs.any-changed == 'true' |
|
run: gh pr edit $PR_NUMBER --add-label feature-flag |
|
env: |
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
|
PR_NUMBER: ${{ github.event.pull_request.number }} |
|
|
|
- name: Remove label |
|
if: steps.collect.outputs.any-changed == 'false' |
|
run: gh pr edit $PR_NUMBER --remove-label feature-flag |
|
env: |
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
|
PR_NUMBER: ${{ github.event.pull_request.number }}
|
|
|