Validate in CI that the GitHub server versions in package.json and version.ts match

This commit is contained in:
Tim Rogers
2025-02-04 12:21:49 +00:00
parent c5968be422
commit d5f719c1a2
2 changed files with 31 additions and 0 deletions

29
.github/workflows/version-check.yml vendored Normal file
View File

@@ -0,0 +1,29 @@
name: Version Consistency Check
on:
push:
branches:
- main
paths:
- "src/github/**"
jobs:
github:
name: Check GitHub server version consistency
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check version consistency
run: |
PACKAGE_VERSION=$(node -p "require('./src/github/package.json').version")
TS_VERSION=$(grep -o '".*"' ./src/github/common/version.ts | tr -d '"')
if [ "$PACKAGE_VERSION" != "$TS_VERSION" ]; then
echo "::error::Version mismatch detected!"
echo "::error::package.json version: $PACKAGE_VERSION"
echo "::error::version.ts version: $TS_VERSION"
exit 1
else
echo "✅ Versions match: $PACKAGE_VERSION"
fi