|
19 | 19 | type: choice |
20 | 20 | required: false |
21 | 21 | options: |
| 22 | + - "" |
22 | 23 | - specifications |
23 | 24 | - reference-apps |
24 | 25 | - automation-testing |
|
33 | 34 | type: choice |
34 | 35 | required: false |
35 | 36 | options: |
| 37 | + - "" |
36 | 38 | - buyer-apps |
37 | 39 | - seller-apps |
38 | 40 | - logistics-apps |
|
45 | 47 | type: choice |
46 | 48 | required: false |
47 | 49 | options: |
| 50 | + - "" |
48 | 51 | - retail |
49 | 52 | - logistics |
50 | 53 | - agriculture |
|
57 | 60 | type: choice |
58 | 61 | required: false |
59 | 62 | options: |
| 63 | + - "" |
60 | 64 | - frontend |
61 | 65 | - backend |
62 | 66 | - mobile |
@@ -112,28 +116,32 @@ jobs: |
112 | 116 | run: | |
113 | 117 | ORG="${ORG}" |
114 | 118 | REPO="${{ github.event.inputs.repo_name }}" |
115 | | -
|
| 119 | + |
| 120 | + # start with empty list |
116 | 121 | TOPICS="[]" |
| 122 | + |
| 123 | + # add only if user selected something |
117 | 124 | 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 }}"]') |
119 | 126 | fi |
120 | 127 | 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 }}"]') |
122 | 129 | fi |
123 | 130 | 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 }}"]') |
125 | 132 | fi |
126 | 133 | 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 }}"]') |
128 | 135 | fi |
129 | 136 |
|
| 137 | + # call GitHub API |
130 | 138 | 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}" |
135 | 143 |
|
136 | | - echo " Topics added: $TOPICS" |
| 144 | + echo " Topics added: $TOPICS" |
137 | 145 |
|
138 | 146 | - name: Install Yeoman |
139 | 147 | run: npm install -g yo |
|
0 commit comments