Skip to content

Commit

Permalink
chore: check that version includes non-numeric characters for manual …
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
thebengeu authored and darora committed Dec 7, 2023
1 parent 4c6d211 commit a51408a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions .github/workflows/ami-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@ jobs:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Run checks if triggered manually
if: ${{ github.event_name == 'workflow_dispatch' }}
# Update `ci.yaml` too if changing constraints.
run: |
SUFFIX=$(sed -E 's/postgres-version = "[0-9\.]+(.*)"/\1/g' common.vars.pkr.hcl)
if [[ -z $SUFFIX ]] ; then
echo "Version must include non-numeric characters if built manually."
exit 1
fi
- id: args
uses: mikefarah/yq@master
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
pull_request:

jobs:

check-release-version:
timeout-minutes: 5
runs-on: ubuntu-latest
Expand All @@ -13,6 +12,7 @@ jobs:
uses: actions/checkout@v3

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

0 comments on commit a51408a

Please sign in to comment.