File tree Expand file tree Collapse file tree 2 files changed +28
-6
lines changed Expand file tree Collapse file tree 2 files changed +28
-6
lines changed Original file line number Diff line number Diff line change 1+ name : Generate script metadata index
2+
3+ on :
4+ push :
5+ branches : [ master ]
6+
7+ jobs :
8+ build :
9+ runs-on : ubuntu-latest
10+ steps :
11+ - uses : actions/checkout@v2
12+ - name : Generate index
13+ run : ./.github/workflows/scripts/generate-index.sh
14+ - name : Upload index.json
15+ run : |
16+ gh release upload metadata-index index.json --clobber --repo "$GITHUB_REPOSITORY"
17+ env :
18+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change 11#! /bin/env bash
2+ #
3+ # Generate index of all script metadata
4+ #
25
3- echo " [" >> concatenated_info.json
6+ FILE_NAME=index.json
7+
8+ echo " [" >> ${FILE_NAME}
49
510# Search for all files named "info.json" and store their paths in an array
611files=( $( find . -name " info.json" ) )
712
813# Loop through the array of files and concatenate their contents into a new file
914for (( i= 0 ; i< ${# files[@]} ; i++ ))
1015do
11- cat " ${files[i]} " >> concatenated_info.json
16+ cat " ${files[i]} " >> ${FILE_NAME}
1217 if [ $i -ne $(( ${# files[@]} - 1 )) ]
1318 then
14- echo " ," >> concatenated_info.json
19+ echo " ," >> ${FILE_NAME}
1520 fi
1621done
1722
18- echo " ]" >> concatenated_info.json
19-
20- echo " Done! Concatenated info.json files can be found in concatenated_info.json."
23+ echo " ]" >> ${FILE_NAME}
2124
25+ echo " Done! Concatenated info.json files can be found in ${FILE_NAME} ."
You can’t perform that action at this time.
0 commit comments