-
Notifications
You must be signed in to change notification settings - Fork 2
52 lines (50 loc) · 2 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Run test file with command:
# act pull_request -e testdata/act/pull-request.json
name: Test find flags
on: pull_request
jobs:
find-feature-flags:
runs-on: ubuntu-latest
name: Test Find Flags
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Find LaunchDarkly feature flags in diff
uses: ./ # Uses an action in the root directory
id: find-flags
with:
project-key: demo-dan-042021-2
environment-key: development
access-token: ${{ secrets.LD_ACCESS_TOKEN_WRITER }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
base-uri: https://app.launchdarkly.com
max-flags: 200
create-flag-links: true
- name: Find flags summary
run: |
echo "flags addded or modified ${{ steps.find-flags.outputs.modified-flags-count }}"
echo "flags removed ${{ steps.find-flags.outputs.removed-flags-count }}"
- name: Added or modified flags
if: steps.find-flags.outputs.any-modified == 'true'
run: |
for flag in ${{ steps.find-flags.outputs.modified-flags }}; do
echo "$flag was added or modified"
done
- name: Removed flags
if: steps.find-flags.outputs.any-removed == 'true'
run: |
for flag in ${{ steps.find-flags.outputs.removed-flags }}; do
echo "$flag was removed"
done
- name: Add label
if: ${{ steps.find-flags.outputs.any-changed == 'true' && github.actor != 'dependabot[bot]' }}
run: gh pr edit $PR_NUMBER --add-label ld-flags
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
- name: Remove label
if: ${{ steps.find-flags.outputs.any-changed == 'false' && github.actor != 'dependabot[bot]' }}
run: gh pr edit $PR_NUMBER --remove-label ld-flags
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}