Skip to content

Commit 869d62b

Browse files
committed
fix: broken ci when merging to main
1 parent 4805eb7 commit 869d62b

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

.github/workflows/agent-ci.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ jobs:
7777
steps:
7878
- name: Checkout repository
7979
uses: actions/checkout@v4
80+
- name: Fetch all tags
81+
run: git fetch --tags --force
8082
# Uses the `docker/login-action` action to log in to the Container registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here.
8183
- name: Log in to the Container registry
8284
uses: docker/login-action@v3
@@ -104,7 +106,7 @@ jobs:
104106
case ${{ github.ref_type }} in
105107
branch)
106108
# The last tag + current git sha
107-
export AGENT_VERSION=$(git tag --list 'agent*' --sort=-v:refname | head -n 1 | cut -d/ -f2 || echo "0.0.0")+${GIT_SHA}
109+
export AGENT_VERSION=$(git tag --list 'agent*' --sort=-v:refname | head -n 1 | cut -d/ -f2)+${GIT_SHA}
108110
TAGS="$TAGS -t ${REGISTRY@L}/${{env.IMAGE_NAME}}/agent:$(echo "${AGENT_VERSION}" | tr + -)"
109111
;;
110112
tag)

.github/workflows/operator-ci.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ jobs:
119119
steps:
120120
- name: Checkout repository
121121
uses: actions/checkout@v4
122-
# Uses the `docker/login-action` action to log in to the Container registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here.
122+
- name: Fetch all tags
123+
run: git fetch --tags --force
123124
- name: Log in to the Container registry
124125
uses: docker/login-action@v3
125126
with:
@@ -148,7 +149,7 @@ jobs:
148149
case ${{ github.ref_type }} in
149150
branch)
150151
# The last tag + current git sha
151-
export OPERATOR_VERSION=$(git tag --list 'operator*' --sort=-v:refname | head -n 1 | cut -d/ -f2 || echo "0.0.0")+${GIT_SHA}
152+
export OPERATOR_VERSION=$(git tag --list 'operator*' --sort=-v:refname | head -n 1 | cut -d/ -f2")+${GIT_SHA}
152153
TAGS="$TAGS -t ${REGISTRY@L}/${{env.IMAGE_NAME}}/operator:$(echo "${OPERATOR_VERSION}" | tr + -)"
153154
;;
154155
tag)

0 commit comments

Comments
 (0)