Skip to content

Commit 6e4cfa1

Browse files
committed
chore: verify bootstrap version format before merge
Relates-to: keymanapp/keyman.com#794 Test-bot: skip
1 parent c7641cd commit 6e4cfa1

3 files changed

Lines changed: 16 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,16 @@ jobs:
8383
source ./_common/tests.inc.sh
8484
set -e
8585
do_test_print_container_error_logs "$CONTAINER_DESC"
86+
87+
- name: Verify .bootstrap-required-version
88+
if: ${{ !cancelled() }}
89+
shell: bash
90+
run: |
91+
# We want to avoid merging a bootstrap version that is not based on a published tag
92+
# in the shared-sites repo. We will do this with a heuristic based on the normal
93+
# shape of the tags, which is `v#.#.#`. Any other shape we will assume is a test
94+
# branch.
95+
cat resources/.bootstrap-required-version | grep -qP '^v\d+\.\d+\.\d+$' || (
96+
echo "::error file=resources/.bootstrap-required-version,line=1,col=1::This branch cannot be merged, because resources/.bootstrap-required-version references \`$(cat resources/.bootstrap-required-version)\`, which does not appear to be a published tag -- is it a test branch?"
97+
exit 1
98+
)

build.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
## START STANDARD SITE BUILD SCRIPT INCLUDE
33
readonly THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
44
readonly BOOTSTRAP="$(dirname "$THIS_SCRIPT")/resources/bootstrap.inc.sh"
5-
readonly BOOTSTRAP_VERSION=feat/linkinator-and-central-test-script
5+
BOOTSTRAP_VERSION="$(cat "$(dirname "THIS_SCRIPT")/resources/.bootstrap-required-version")" || exit 1
6+
readonly BOOTSTRAP_VERSION
67
if ! [ -f "$BOOTSTRAP" ] || ! source "$BOOTSTRAP"; then
78
curl -H "Cache-Control: no-cache" --fail --silent --show-error -w "curl: Finished attempt to download %{url}" "https://raw.githubusercontent.com/keymanapp/shared-sites/$BOOTSTRAP_VERSION/bootstrap.inc.sh" -o "$BOOTSTRAP.tmp" || exit 1
89
source "$BOOTSTRAP.tmp"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v1.0.14

0 commit comments

Comments
 (0)