mirror of
https://github.com/ossf/scorecard.git
synced 2024-11-12 17:12:47 +03:00
Fix - Made the results.json wellformed from cron
Fixed the results.json to be wellformed from the cron job. Changed the docker image from gsutil to cloudsdk:slim to `sed` binary which is being used with the cron.sh
This commit is contained in:
parent
b8768a0eb3
commit
0eaa4ff3d0
@ -26,7 +26,7 @@ ARG TARGETOS
|
||||
ARG TARGETARCH
|
||||
RUN CGO_ENABLED=0 go build -a -tags netgo -ldflags '-w -extldflags "-static"' -o /out/scorecard .
|
||||
|
||||
FROM gcr.io/cloud-builders/gsutil
|
||||
FROM gcr.io/google.com/cloudsdktool/cloud-sdk:slim
|
||||
COPY --from=build /out/scorecard /
|
||||
COPY ./cron/ /cron/
|
||||
ENTRYPOINT [ "/scorecard" ]
|
||||
|
@ -17,7 +17,7 @@ SOURCE="${BASH_SOURCE[0]}"
|
||||
input=$(dirname "$SOURCE")/projects.txt
|
||||
output=$(date +"%m-%d-%Y").json
|
||||
touch "$output"
|
||||
curl https://raw.githubusercontent.com/ossf/scorecard/main/cron/projects.txt >projects.txt
|
||||
echo "{ \"results\": [" >> "$output"
|
||||
|
||||
# sort and uniqify these, in case there are duplicates
|
||||
# shellcheck disable=SC2002
|
||||
@ -28,7 +28,10 @@ while read -r proj; do
|
||||
fi
|
||||
echo "$proj"
|
||||
../scorecard --repo="$proj" --show-details --format=json >> "$output"
|
||||
echo "," >> "$output"
|
||||
done <<< "$projects"
|
||||
sed -i '$d' "$output" # removing the trailing comma which will be last line.
|
||||
echo "]}" >> "$output"
|
||||
|
||||
gsutil cp "$output" gs://"$GCS_BUCKET"
|
||||
# Also copy the most recent run into a "latest.json" file
|
||||
|
Loading…
Reference in New Issue
Block a user