Skip to content

Commit a868d8e

Browse files
committed
refactor
1 parent 0d598fb commit a868d8e

1 file changed

Lines changed: 16 additions & 14 deletions

File tree

.github/workflows/build.yml

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -158,20 +158,22 @@ jobs:
158158
env:
159159
GH_TOKEN: ${{ github.token }}
160160
run: |
161-
python -c 'txt=open("LEGORACERS-diff.txt").read().strip(); open("LEGORACERS-diff.txt", "w").write(txt);'
162-
python -c 'txt=open("GOLDP-diff.txt").read().strip(); open("GOLDP-diff.txt", "w").write(txt);'
163-
164-
cat <<EOF >reccmp-pr-message.txt
165-
# reccmp report
166-
## LEGORACERS (LEGORacers.exe)
167-
\`\`\`
168-
$(cat LEGORACERS-diff.txt | sed 's/\x1b\[[0-9;]*m//g')
169-
\`\`\`
170-
## GOLDP (GolDP.dll)
171-
\`\`\`
172-
$(cat GOLDP-diff.txt | sed 's/\x1b\[[0-9;]*m//g')
173-
\`\`\`
174-
EOF
161+
section() {
162+
echo "## $1"
163+
echo '```'
164+
if [ -f "$2" ]; then
165+
python -c "print(open('$2').read().strip())'
166+
else
167+
echo '(no diff available)';
168+
fi
169+
echo '```'
170+
}
171+
172+
{
173+
echo '# reccmp report'
174+
section 'LEGORACERS (LEGORacers.exe)' LEGORACERS-diff.txt
175+
section 'GOLDP (GolDP.dll)' GOLDP-diff.txt
176+
} >reccmp-pr-message.txt
175177
176178
echo "${{ github.event.number }}" >pr-number.txt
177179

0 commit comments

Comments
 (0)