Skip to content
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
5 changes: 5 additions & 0 deletions .github/workflows/proxy_integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ jobs:
- name: Run typecheck
run: npm run test:types

- name: Check npm and JSR package contents
run: |
npm pack --dry-run
npx --yes jsr publish --dry-run

- name: Require PROXY_URL Actions secret
env:
PROXY_URL: ${{ secrets.PROXY_URL }}
Expand Down
36 changes: 36 additions & 0 deletions scripts/check-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env bash
# Check that package.json, package-lock.json and jsr.json carry the same
# version, and that a release/X.Y.Z branch carries version X.Y.Z.
# scripts/lint.sh runs this; on pull requests the branch comes from
# GITHUB_HEAD_REF.

set -euo pipefail

err() {
echo "$*" >&2
}

# Print the "version" field of a JSON file.
version_of() {
node -p "require('./$1').version"
}

main() {
cd "$(git rev-parse --show-toplevel)"
local version file other branch
version="$(version_of package.json)"
for file in package-lock.json jsr.json; do
other="$(version_of "${file}")"
if [[ "${other}" != "${version}" ]]; then
err "${file} version ${other} != package.json version ${version}"
exit 1
fi
done
branch="${GITHUB_HEAD_REF:-$(git rev-parse --abbrev-ref HEAD)}"
if [[ "${branch}" == release/* && "${branch#release/}" != "${version}" ]]; then
err "branch ${branch} != package.json version ${version}"
exit 1
fi
}

main "$@"
1 change: 1 addition & 0 deletions scripts/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ main() {
fi
check shellcheck shellcheck "${sh_files[@]}"
check shfmt shfmt -d -i 2 -ci "${sh_files[@]}"
check version scripts/check-version.sh
check eslint npm run lint --silent

if ((${#failed[@]} > 0)); then
Expand Down