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
3 changes: 3 additions & 0 deletions .github/workflows/proxy_integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ jobs:
bundler-cache: true
ruby-version: ruby

- name: Build the gem
run: gem build ruby-proxy-headers.gemspec

- name: Require PROXY_URL Actions secret
env:
PROXY_URL: ${{ secrets.PROXY_URL }}
Expand Down
29 changes: 29 additions & 0 deletions scripts/check-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env bash
# Check that version.rb and Gemfile.lock carry the same gem 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
}

main() {
cd "$(git rev-parse --show-toplevel)"
local version lock branch
version="$(sed -nE "s/^ *VERSION = '([^']+)'$/\1/p" \
lib/ruby_proxy_headers/version.rb)"
lock="$(sed -nE 's/^ ruby-proxy-headers \(([^)]+)\)$/\1/p' Gemfile.lock)"
branch="${GITHUB_HEAD_REF:-$(git rev-parse --abbrev-ref HEAD)}"
if [[ -z "${version}" || "${lock}" != "${version}" ]]; then
err "version.rb '${version}' != Gemfile.lock '${lock}'; run bundle install"
exit 1
fi
if [[ "${branch}" == release/* && "${branch#release/}" != "${version}" ]]; then
err "branch ${branch} != version.rb ${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 @@ -44,6 +44,7 @@ main() {
fi
check shellcheck shellcheck "${sh_files[@]}"
check shfmt shfmt -d -i 2 -ci "${sh_files[@]}"
check version scripts/check-version.sh
check rubocop bundle exec rubocop

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