File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 4343 cat org-name.txt
4444 echo "Full list of repos in org:"
4545 cat repo-list.txt
46+
47+ - name : Fetch custom properties for each repo
48+ shell : bash
49+ env :
50+ GH_TOKEN : ${{ inputs.token }}
51+ run : |
52+ ORG_NAME="${GITHUB_REPOSITORY%%/*}"
53+ echo "Fetching custom properties for repos in org: ${ORG_NAME}"
54+
55+ echo "{" > repo-properties.json
56+ FIRST=1
57+ while IFS= read -r REPO_NAME; do
58+ echo "Getting properties for ${REPO_NAME}..."
59+ RESPONSE=$(gh api "repos/${ORG_NAME}/${REPO_NAME}/properties/values" || echo "{}")
60+
61+ # If not the first, prepend a comma to separate JSON entries
62+ if [ "$FIRST" -eq 0 ]; then
63+ echo "," >> repo-properties.json
64+ fi
65+ FIRST=0
66+
67+ # Output as "repo-name": { ...props... }
68+ echo "\"${REPO_NAME}\": $RESPONSE" >> repo-properties.json
69+ done < repo-list.txt
70+ echo "}" >> repo-properties.json
71+
72+ echo "Custom properties written to repo-properties.json"
73+
74+ - name : Print out the full repo-properties.json file
75+ shell : bash
76+ run : |
77+ echo "Full repo-properties.json file is:"
78+ cat repo-properties.json
You can’t perform that action at this time.
0 commit comments