-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate_launchdarkly_code_references.yml
More file actions
48 lines (45 loc) · 1.52 KB
/
template_launchdarkly_code_references.yml
File metadata and controls
48 lines (45 loc) · 1.52 KB
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
name: Find LaunchDarkly flag code references
on:
workflow_call:
inputs:
project-key:
required: false
type: string
default: 'default'
secrets:
access-token:
required: true
jobs:
launchDarklyCodeReferences:
name: Find LaunchDarkly flag code references
runs-on: ubuntu-slim
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Create Files
run: |
mkdir .launchdarkly
cat <<EOT >> .launchdarkly/coderefs.yml
aliases:
- type: camelcase
- type: command
command: "./.launchdarkly/flag-alias.sh"
timeout: 5
EOT
cat <<EOT >> .launchdarkly/flag-alias.sh
#!/bin/sh
read flagKey <&0; echo "[\"\$flagKey\",\"\$(echo \$flagKey | awk '{print tolower(\$0)}' | awk -F'-' '{for(i=1;i<=NF;i++){\$i=toupper(substr(\$i,1,1)) substr(\$i,2)}} 1' OFS='' | awk '{print tolower(substr(\$0,0,1))substr(\$0,2)}')\"]"
EOT
chmod +x .launchdarkly/flag-alias.sh
- name: Show Files
run: |
cat .launchdarkly/coderefs.yml
cat .launchdarkly/flag-alias.sh
- name: LaunchDarkly Code References
uses: launchdarkly/find-code-references@89a7d362d1d4b3725fe0fe0ccd0dc69e3bdcba58 # v2.14.0
with:
accessToken: ${{ secrets.access-token }}
projKey: ${{ inputs.project-key }}
debug: true