Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/version-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Version Consistency Check

on:
push:
branches:
- main
pull_request:
release:
types: [published]

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
2 changes: 2 additions & 0 deletions src/github/common/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
// If the format of this file changes, so it doesn't simply export a VERSION constant,
// this will break .github/workflows/version-check.yml.
export const VERSION = "0.6.2";
Loading