Skip to content

Commit 0d1fec1

Browse files
committed
Fikse problem med github.ref
1 parent b1e1e9e commit 0d1fec1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

.github/workflows/buildAndPublish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ jobs:
5151
echo "${newLine}"
5252
echo "${yellow}Checking if there has been changes to source code by running git diff on the src folder excluding markdown files${reset}"
5353
54-
GIT_REF=${{ github.ref }}
55-
5654
if [ "$GITHUB_EVENT_NAME" == "workflow_run" ]; then
57-
GIT_REF=${{ github.event.workflow_run.head_branch }}
55+
GIT_REF="${{ github.event.workflow_run.head_branch }}"
56+
else
57+
GIT_REF="${GITHUB_REF#refs/heads/}" # Strip refs/heads/ from github.ref
5858
fi
5959
6060
changes=$(git diff "$GIT_REF"^ "$GIT_REF" --ignore-all-space --name-only -- src/)

0 commit comments

Comments
 (0)