Skip to content

Commit

Permalink
using a temp file
Browse files Browse the repository at this point in the history
prior run was failing. might be due to persisting the old file.
  • Loading branch information
benlower committed Apr 26, 2024
1 parent 86e7695 commit 62e3d12
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,17 @@ jobs:

- name: Get data and update file
run: |
OUTPUT="$(node ./utils/GenerateLatestData.js 2>err.txt)"
FILE="err.txt"
if [[ -f "$FILE" ]]; then
TEMP_FILE=$(mktemp)
OUTPUT="$(node ./utils/GenerateLatestData.js 2>$TEMP_FILE)"
if [[ -f "$TEMP_FILE" ]]; then
# Read the file contents and echo them so they are captured by the GitHub Actions runner
while read -r line; do
echo "$line"
done < "$FILE"
done < "$TEMP_FILE"
# Delete the file
rm "$FILE"
rm "$TEMP_FILE"
exit 1
elif [ -n "$OUTPUT" ]; then
echo "$OUTPUT" > ./website/public/data/latest.json
Expand Down

0 comments on commit 62e3d12

Please sign in to comment.