Skip to content

Commit d39d274

Browse files
samrosedarora
authored andcommitted
chore: update ci.yml to reflect where data is now stored
1 parent 12d6584 commit d39d274

File tree

1 file changed

+32
-6
lines changed

1 file changed

+32
-6
lines changed

.github/workflows/ci.yml

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,37 @@ jobs:
1111
- name: Checkout Repo
1212
uses: actions/checkout@v3
1313

14+
- name: Load postgres_release values
15+
id: load_postgres_release
16+
uses: mikefarah/yq@master
17+
with:
18+
args: eval '.postgres_release' ansible/vars.yml
19+
# The output will be available as steps.load_postgres_release.outputs.stdout
20+
1421
- name: Run checks
15-
# Update `ami-release.yaml` too if changing constraints.
1622
run: |
17-
SUFFIX=$(sed -E 's/postgres-version = "[0-9\.]+(.*)"/\1/g' common.vars.pkr.hcl)
18-
if [[ -n $SUFFIX ]] ; then
19-
echo "We no longer allow merging RC versions to develop."
20-
exit 1
21-
fi
23+
POSTGRES_RELEASES="${{ steps.load_postgres_release.outputs.stdout }}"
24+
25+
# Iterate through each release
26+
for release in $(echo "$POSTGRES_RELEASES" | yq eval 'keys | .[]' -); do
27+
VERSION=$(echo "$POSTGRES_RELEASES" | yq eval ".\"$release\"" -)
28+
if [[ "$release" == "postgresorioledb-17" ]]; then
29+
# Check for suffix after -orioledb
30+
if [[ "$VERSION" =~ -orioledb(.*) ]]; then
31+
SUFFIX="${BASH_REMATCH[1]}"
32+
if [[ -n "$SUFFIX" ]]; then
33+
echo "We no longer allow merging versions with suffixes after -orioledb."
34+
exit 1
35+
fi
36+
fi
37+
else
38+
# Check for suffix after version digits
39+
if [[ "$VERSION" =~ ([0-9]+\.[0-9]+\.[0-9]+)(.*) ]]; then
40+
SUFFIX="${BASH_REMATCH[2]}"
41+
if [[ -n "$SUFFIX" ]]; then
42+
echo "We no longer allow merging versions with suffixes after version $VERSION."
43+
exit 1
44+
fi
45+
fi
46+
fi
47+
done

0 commit comments

Comments
 (0)