2024-01-26 20:20:12 +01:00
|
|
|
---
|
|
|
|
name: Collect code references
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
branches-ignore:
|
|
|
|
- "renovate/**"
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
pull-requests: write
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
refs:
|
|
|
|
name: Code reference collection
|
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
steps:
|
|
|
|
- name: Check out repository
|
2024-07-10 21:47:20 +02:00
|
|
|
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
2024-01-26 20:20:12 +01:00
|
|
|
|
|
|
|
- name: Collect
|
|
|
|
id: collect
|
2024-07-10 21:54:06 +02:00
|
|
|
uses: launchdarkly/find-code-references-in-pull-request@d008aa4f321d8cd35314d9cb095388dcfde84439 # v2.0.0
|
2024-01-26 20:20:12 +01:00
|
|
|
with:
|
|
|
|
project-key: default
|
|
|
|
environment-key: dev
|
|
|
|
access-token: ${{ secrets.LD_ACCESS_TOKEN }}
|
|
|
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
|
|
- 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 }}
|