diff --git a/.github/workflows/version-check.yml b/.github/workflows/version-check.yml new file mode 100644 index 0000000000..35b2f17515 --- /dev/null +++ b/.github/workflows/version-check.yml @@ -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 diff --git a/src/github/common/version.ts b/src/github/common/version.ts index 00b8a69183..648f7c6b92 100644 --- a/src/github/common/version.ts +++ b/src/github/common/version.ts @@ -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"; \ No newline at end of file