Skip to content

Commit 10dc9fb

Browse files
committed
Fix Github Actions versioned image push (feast-dev#994)
* Fix push semver versioned ci image not being pushed if has semver suffix. * Add comments to document semver regex. * Replace regular expression matcher with grep -P for Perl regex style matching.
1 parent 845370c commit 10dc9fb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

.github/workflows/master_only.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,10 @@ jobs:
4242
- name: Push versioned release
4343
run: |
4444
# Build and push semver tagged commits
45-
rx='^v[0-9]+?\.[0-9]+?\.[0-9]+?$'
46-
if [[ "${RELEASE_VERSION}" =~ $rx ]]; then
45+
# Regular expression should match MAJOR.MINOR.PATCH[-PRERELEASE[.IDENTIFIER]]
46+
# eg. v0.7.1 v0.7.2-alpha v0.7.2-rc.1
47+
rx='^v([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))$ '
48+
if echo "${RELEASE_VERSION}" | grep -P "$rx" &>/dev/null ; then
4749
VERSION_WITHOUT_PREFIX=${RELEASE_VERSION:1}
4850
4951
docker tag gcr.io/kf-feast/feast-${{ matrix.component }}:${GITHUB_SHA} gcr.io/kf-feast/feast-${{ matrix.component }}:${VERSION_WITHOUT_PREFIX}

0 commit comments

Comments
 (0)