Skip to content

Commit ee61b32

Browse files
authored
Update pipeline.yml
1 parent d88debe commit ee61b32

1 file changed

Lines changed: 18 additions & 10 deletions

File tree

.github/workflows/pipeline.yml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ on:
1919
type: choice
2020
required: false
2121
options:
22+
- ""
2223
- specifications
2324
- reference-apps
2425
- automation-testing
@@ -33,6 +34,7 @@ on:
3334
type: choice
3435
required: false
3536
options:
37+
- ""
3638
- buyer-apps
3739
- seller-apps
3840
- logistics-apps
@@ -45,6 +47,7 @@ on:
4547
type: choice
4648
required: false
4749
options:
50+
- ""
4851
- retail
4952
- logistics
5053
- agriculture
@@ -57,6 +60,7 @@ on:
5760
type: choice
5861
required: false
5962
options:
63+
- ""
6064
- frontend
6165
- backend
6266
- mobile
@@ -112,28 +116,32 @@ jobs:
112116
run: |
113117
ORG="${ORG}"
114118
REPO="${{ github.event.inputs.repo_name }}"
115-
119+
120+
# start with empty list
116121
TOPICS="[]"
122+
123+
# add only if user selected something
117124
if [ -n "${{ github.event.inputs.select_category_topic }}" ]; then
118-
TOPICS=$(echo $TOPICS | jq ". + [\"category-${{ github.event.inputs.select_category_topic }}\"]")
125+
TOPICS=$(echo $TOPICS | jq '. + ["category-${{ github.event.inputs.select_category_topic }}"]')
119126
fi
120127
if [ -n "${{ github.event.inputs.select_subcategory_topic }}" ]; then
121-
TOPICS=$(echo $TOPICS | jq ". + [\"subcategory-${{ github.event.inputs.select_subcategory_topic }}\"]")
128+
TOPICS=$(echo $TOPICS | jq '. + ["subcategory-${{ github.event.inputs.select_subcategory_topic }}"]')
122129
fi
123130
if [ -n "${{ github.event.inputs.select_type_topic }}" ]; then
124-
TOPICS=$(echo $TOPICS | jq ". + [\"type-${{ github.event.inputs.select_type_topic }}\"]")
131+
TOPICS=$(echo $TOPICS | jq '. + ["type-${{ github.event.inputs.select_type_topic }}"]')
125132
fi
126133
if [ -n "${{ github.event.inputs.select_domain_topic }}" ]; then
127-
TOPICS=$(echo $TOPICS | jq ". + [\"domain-${{ github.event.inputs.select_domain_topic }}\"]")
134+
TOPICS=$(echo $TOPICS | jq '. + ["domain-${{ github.event.inputs.select_domain_topic }}"]')
128135
fi
129136

137+
# call GitHub API
130138
curl -X PUT \
131-
-H "Authorization: token ${{ secrets.PAT_TOKEN }}" \
132-
-H "Accept: application/vnd.github+json" \
133-
https://api.github.com/repos/$ORG/$REPO/topics \
134-
-d "{\"names\": $TOPICS}"
139+
-H "Authorization: token ${{ secrets.PAT_TOKEN }}" \
140+
-H "Accept: application/vnd.github+json" \
141+
https://api.github.com/repos/$ORG/$REPO/topics \
142+
-d "{\"names\": $TOPICS}"
135143

136-
echo " Topics added: $TOPICS"
144+
echo " Topics added: $TOPICS"
137145

138146
- name: Install Yeoman
139147
run: npm install -g yo

0 commit comments

Comments
 (0)