Skip to content

Commit 58f3f44

Browse files
authored
1 parent 9896524 commit 58f3f44

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -325,14 +325,20 @@ jobs:
325325
python-version: '3.10'
326326

327327
- name: Check if extension versions are updated
328-
# check against latest tag on the target branch
329-
# base_ref should be empty if not a pull request, so goes from HEAD
330328
run: |
331-
BASE_SHA=$(git rev-parse origin/${{ github.base_ref }})
332-
LAST_TAG=$(git describe --abbrev=0 --match="tket2-*" $BASE_SHA)
329+
# Check against latest tag on the target branch
330+
# When not on a pull request, base_ref should be empty so we default to HEAD
331+
if [ -z "$TARGET_REF" ]; then
332+
BASE_SHA=""
333+
else
334+
BASE_SHA=$(git rev-parse origin/$TARGET_REF)
335+
fi
336+
LAST_TAG=$(git describe --abbrev=0 --match="tket2t c-*" $BASE_SHA)
333337
echo "Latest tag on target: $LAST_TAG"
334-
338+
335339
python ./scripts/check_extension_versions.py $LAST_TAG
340+
env:
341+
TARGET_REF: ${{ github.base_ref }}
336342

337343
# This is a meta job to mark successful completion of the required checks,
338344
# even if they are skipped due to no changes in the relevant files.

0 commit comments

Comments
 (0)