1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-25 12:45:18 +01:00

Feature flag code reference collection (#3444)

* Feature flag code reference collection

* Provide project

* Try another key

* Use different workflow

* Touch a feature flag to test detection

* Adjust permissions

* Remove another flag

* Bump workflow

* Add label

* Undo changes to constants

* One more test

* Fix logic

* Identify step

* Try modified

* Adjust a flag

* Remove test

* Try with Boolean

* Changed

* Undo flag change again

* Ignore Renovate

Co-authored-by: MtnBurrit0 <77340197+mimartin12@users.noreply.github.com>

* Line break

---------

Co-authored-by: MtnBurrit0 <77340197+mimartin12@users.noreply.github.com>
This commit is contained in:
Matt Bishop 2024-01-26 14:20:12 -05:00 committed by GitHub
parent 2763345e9e
commit 59b40f36d9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

42
.github/workflows/code-references.yml vendored Normal file
View File

@ -0,0 +1,42 @@
---
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
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Collect
id: collect
uses: launchdarkly/find-code-references-in-pull-request@2e9333c88539377cfbe818c265ba8b9ebced3c91 # v1.1.0
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 }}