Skip to content

Commit 771848d

Browse files
Refactor Github Action per b/485167538 (#610)
Co-authored-by: Ben Knutson <benknutson@google.com>
1 parent 967f124 commit 771848d

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

.github/workflows/build-and-push-to-gcr.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@ jobs:
2222
- name: Check release version
2323
id: check-tag
2424
run: |
25-
echo "version=$(echo ${{ github.event.ref }} | cut -d / -f 3 | cut -c2-)" >> $GITHUB_OUTPUT
26-
if [[ ${{ github.event.ref }} =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
25+
echo "version=$(echo ${GITHUB_EVENT_REF} | cut -d / -f 3 | cut -c2-)" >> $GITHUB_OUTPUT
26+
if [[ ${GITHUB_EVENT_REF} =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
2727
echo "match=true" >> $GITHUB_OUTPUT
2828
fi
29+
env:
30+
GITHUB_EVENT_REF: ${{ github.event.ref }}
2931

3032
- name: Authenticate to GCP
3133
id: authenticate

.github/workflows/deploy.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@ jobs:
1919
- name: Check release version
2020
id: check-tag
2121
run: |
22-
echo "version=$(echo ${{ github.event.ref }} | cut -d / -f 3 | cut -c2-)" >> $GITHUB_OUTPUT
23-
if [[ ${{ github.event.ref }} =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
22+
echo "version=$(echo ${GITHUB_EVENT_REF} | cut -d / -f 3 | cut -c2-)" >> $GITHUB_OUTPUT
23+
if [[ ${GITHUB_EVENT_REF} =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
2424
echo "match=true" >> $GITHUB_OUTPUT
2525
fi
26+
env:
27+
GITHUB_EVENT_REF: ${{ github.event.ref }}
2628

2729
- name: Authenticate to GCP
2830
id: authenticate

0 commit comments

Comments
 (0)