mirror of https://github.com/OpenRCT2/OpenRCT2.git
Update CI workflow
This commit is contained in:
parent
8d7db5e987
commit
a927335f8a
|
@ -58,6 +58,17 @@ jobs:
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- name: Run clang-format
|
- name: Run clang-format
|
||||||
run: scripts/check-code-formatting
|
run: scripts/check-code-formatting
|
||||||
|
check-changelog-formatting:
|
||||||
|
name: Check changelog formatting
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: bash
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Run check-changelog-formatting
|
||||||
|
run: scripts/check-changelog-formatting
|
||||||
windows:
|
windows:
|
||||||
name: Windows
|
name: Windows
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Run the script and capture the output
|
||||||
|
output=$(node scripts/format-changelog.js distribution/changelog.txt)
|
||||||
|
|
||||||
|
# Check if the script ran successfully
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
echo "Script ran successfully. Running diff..."
|
||||||
|
# Run diff on the original file and the output
|
||||||
|
diff --color=always -b <(echo "$output") distribution/changelog.txt
|
||||||
|
# If diff finds differences, exit with a non-zero status
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "Differences found. Exiting with status 1."
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo "No differences found. Exiting with status 0."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "Script encountered an error:"
|
||||||
|
echo "$output"
|
||||||
|
exit 1
|
||||||
|
fi
|
Loading…
Reference in New Issue