Skip to content

Commit 878fefb

Browse files
committed
👷 Differentiate branch & tag
1 parent 99abf2d commit 878fefb

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.circleci/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version: 2.1
44
parameters:
55
branch:
66
type: string
7-
default: unknown
7+
default: no branch
88
owner:
99
type: string
1010
default: unknown

.github/workflows/build_and_test.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,12 @@ jobs:
103103
echo "ref: $GITHUB_REF_NAME"
104104
TEXT="Triggered pipeline at "
105105
U1="https://circleci.com/api/v2/project/gh/${GITHUB_REPOSITORY}/pipeline"
106-
DATA="{\"branch\":\"$GITHUB_REF_NAME\", \"parameters\": {\"run_tests\": true}}"
106+
if [[ "${GITHUB_REF_TYPE}" == "tag" ]]
107+
then
108+
export DATA="{\"tag\":\"$GITHUB_REF_NAME\", \"parameters\": {\"run_tests\": true}}"
109+
else
110+
export DATA="{\"branch\":\"$GITHUB_REF_NAME\", \"parameters\": {\"run_tests\": true}}"
111+
fi
107112
echo "URL ${U1}"
108113
echo "data ${DATA}"
109114
PIPELINE_NUMBER=$(curl \

0 commit comments

Comments
 (0)