Skip to content

Commit 43f2020

Browse files
committed
Support working offline by using local git commands
1 parent 4e255fe commit 43f2020

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

.github/workflows/public-analyze-code-graph.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ jobs:
100100
repository: JohT/code-graph-analysis-pipeline
101101
ref: ${{ inputs.ref }}
102102
persist-credentials: false
103+
fetch-tags: true
103104

104105
- name: (Java Setup) Java Development Kit (JDK) ${{ matrix.java }}
105106
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5

domains/anomaly-detection/summary/anomalyDetectionSummary.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,10 @@ anomaly_detection_front_matter_metadata_head() {
127127
current_date="$(date +'%Y-%m-%d')"
128128

129129
local latest_tag
130-
latest_tag="$(git ls-remote --tags origin | grep -v '\^{}' | tail -n1 | awk '{print $2}' | sed 's|refs/tags/||')"
130+
# The latest tag can always be determined by reading the remote repository. However, this doesn't support working offline.
131+
# Therefore, git describe is used which - on the other hand - requires tags to be fetched which requires GitHub Action checkout parameter fetch-tags.
132+
#latest_tag="$(git ls-remote --tags origin | grep -v '\^{}' | tail -n1 | awk '{print $2}' | sed 's|refs/tags/||')"
133+
latest_tag="$(git for-each-ref --sort=-creatordate --count=1 --format '%(refname:short)' refs/tags)"
131134

132135
local analysis_directory
133136
analysis_directory="${PWD##*/}"

0 commit comments

Comments
 (0)