Skip to content

Commit fe3e3ed

Browse files
Merge pull request #4 from joshjohanning/joshjohanning-patch-1
fix output file name input
2 parents 686b2df + b79a6cf commit fe3e3ed

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

github-actions-log-warning-checker.sh

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,23 @@ if [ $# -lt "2" ]; then
1515
exit 1
1616
fi
1717

18-
if [ ! -f "$1" ]; then
19-
echo "Repo input file $1 does not exist"
18+
filename="$1"
19+
output="$2"
20+
21+
if [ ! -f "$filename" ]; then
22+
echo "Repo input file $filename does not exist"
2023
exit 1
2124
fi
2225

23-
# mv output.log if it exists
24-
if [ -f "$2" ]; then
26+
# mv output file if it exists
27+
if [ -f "$output" ]; then
2528
date=$(date +"%Y-%m-%d %T")
26-
mv $2 "$2-$date.csv"
29+
mv $output "$output-$date.csv"
2730
fi
2831

29-
echo "repo,workflow_name,workflow_url,found_in_latest_workflow_run" > output.csv
3032

31-
filename="$1"
33+
34+
echo "repo,workflow_name,workflow_url,found_in_latest_workflow_run" > $output
3235

3336
while read -r repofull ;
3437
do
@@ -62,7 +65,7 @@ do
6265
else
6366
latest="no"
6467
fi
65-
echo "$org/$repo,$workflow_name,$workflow_url,$latest" >> output.csv
68+
echo "$org/$repo,$workflow_name,$workflow_url,$latest" >> $output
6669
break
6770
fi
6871
i=$((i+1))

0 commit comments

Comments
 (0)