Skip to content

Commit b4e33d7

Browse files
committed
add fallback
1 parent 39c6336 commit b4e33d7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

.github/workflows/build-sample-apps.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,9 @@ jobs:
167167
sd "workspaceName: '.*'" "workspaceName: '${{ matrix.sample-app.cio-workspace-name }}'" "$ENV_FILE"
168168
sd "branchName: '.*'" "branchName: '$BRANCH_NAME'" "$ENV_FILE"
169169
sd "commitHash: '.*'" "commitHash: '${COMMIT_HASH:0:7}'" "$ENV_FILE"
170-
sd "commitsAheadCount: '.*'" "commitsAheadCount: '$(git rev-list $(git describe --tags --abbrev=0)..HEAD --count)'" "$ENV_FILE"
170+
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "untagged")
171+
COMMITS_AHEAD=$(git rev-list $LAST_TAG..HEAD --count 2>/dev/null || echo "untracked")
172+
sd "commitsAheadCount: '.*'" "commitsAheadCount: '$COMMITS_AHEAD'" "$ENV_FILE"
171173
172174
- name: Setup workspace credentials in iOS environment files
173175
working-directory: Apps/${{ matrix.sample-app.name }}/ios

0 commit comments

Comments
 (0)