mirror of
https://github.com/bitwarden/server.git
synced 2025-05-08 21:22:20 -05:00

* Run LD reference check on all pushes * Fix syntax of code-references.yml --------- Co-authored-by: Matt Andreko <mandreko@bitwarden.com>
61 lines
1.7 KiB
YAML
61 lines
1.7 KiB
YAML
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 }}
|