Skip to content

Commit a51408a

Browse files
thebengeudarora
authored andcommitted
chore: check that version includes non-numeric characters for manual AMI builds
To avoid situations such as #823. This also disallows simply appending .e.g ".1", which is against https://semver.org/ for pre-release versions, and it's good to have more descriptive identifiers.
1 parent 4c6d211 commit a51408a

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

.github/workflows/ami-release.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,16 @@ jobs:
3030
- name: Checkout Repo
3131
uses: actions/checkout@v3
3232

33+
- name: Run checks if triggered manually
34+
if: ${{ github.event_name == 'workflow_dispatch' }}
35+
# Update `ci.yaml` too if changing constraints.
36+
run: |
37+
SUFFIX=$(sed -E 's/postgres-version = "[0-9\.]+(.*)"/\1/g' common.vars.pkr.hcl)
38+
if [[ -z $SUFFIX ]] ; then
39+
echo "Version must include non-numeric characters if built manually."
40+
exit 1
41+
fi
42+
3343
- id: args
3444
uses: mikefarah/yq@master
3545
with:

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44
pull_request:
55

66
jobs:
7-
87
check-release-version:
98
timeout-minutes: 5
109
runs-on: ubuntu-latest
@@ -13,6 +12,7 @@ jobs:
1312
uses: actions/checkout@v3
1413

1514
- name: Run checks
15+
# Update `ami-release.yaml` too if changing constraints.
1616
run: |
1717
SUFFIX=$(sed -E 's/postgres-version = "[0-9\.]+(.*)"/\1/g' common.vars.pkr.hcl)
1818
if [[ -n $SUFFIX ]] ; then

0 commit comments

Comments
 (0)