Skip to content

Commit be8c9e8

Browse files
committed
read the props to build up the template file
Signed-off-by: Andrew Brandt <[email protected]>
1 parent 13bcdbe commit be8c9e8

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

action.yaml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,19 @@ runs:
4141
sudo chmod +x /usr/bin/yq
4242
yq --version # confirm installed
4343
44+
- name: Extract property names into a JSON array
45+
shell: bash
46+
env:
47+
GH_TOKEN: ${{ inputs.token }} # or use your PAT if needed
48+
run: |
49+
ORG=$(cat org-name.txt)
50+
echo "Fetching property schema for org: $ORG"
51+
52+
gh api --paginate "orgs/$ORG/properties/schema" \
53+
| jq 'map(.property_name)' > property-names.json
54+
55+
echo "Property names written to property-names.json"
56+
4457
- name: List all repos in org
4558
shell: bash
4659
env:
@@ -98,14 +111,14 @@ runs:
98111
shell: bash
99112
run: |
100113
echo "The template file for JSON output is:"
101-
cat ${{ inputs.template }}
114+
cat property-names.json
102115
103116
- name: Convert repo properties to YAML using template
104117
shell: bash
105118
run: |
106119
ORG_NAME=$(cat org-name.txt)
107120
108-
TEMPLATE=$(cat ${{ inputs.template }})
121+
TEMPLATE=$(cat property-names.json)
109122
110123
{
111124
echo "org: $ORG_NAME"

0 commit comments

Comments
 (0)