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 1
1
#! /bin/env bash
2
+ #
3
+ # Generate index of all script metadata
4
+ #
2
5
3
- echo " [" >> concatenated_info.json
6
+ FILE_NAME=index.json
7
+
8
+ echo " [" >> ${FILE_NAME}
4
9
5
10
# Search for all files named "info.json" and store their paths in an array
6
11
files=( $( find . -name " info.json" ) )
7
12
8
13
# Loop through the array of files and concatenate their contents into a new file
9
14
for (( i= 0 ; i< ${# files[@]} ; i++ ))
10
15
do
11
- cat " ${files[i]} " >> concatenated_info.json
16
+ cat " ${files[i]} " >> ${FILE_NAME}
12
17
if [ $i -ne $(( ${# files[@]} - 1 )) ]
13
18
then
14
- echo " ," >> concatenated_info.json
19
+ echo " ," >> ${FILE_NAME}
15
20
fi
16
21
done
17
22
18
- echo " ]" >> concatenated_info.json
19
-
20
- echo " Done! Concatenated info.json files can be found in concatenated_info.json."
23
+ echo " ]" >> ${FILE_NAME}
21
24
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