File tree Expand file tree Collapse file tree 1 file changed +38
-1
lines changed Expand file tree Collapse file tree 1 file changed +38
-1
lines changed Original file line number Diff line number Diff line change @@ -153,8 +153,45 @@ jobs:
153153 echo "EOF"
154154 } >> $GITHUB_OUTPUT
155155
156- - name : Post summary
156+ - name : Ensure release labels
157157 if : steps.check_version.outputs.is_minor_bump == 'true'
158+ env :
159+ GH_TOKEN : ${{ secrets.PR_GH_TOKEN || secrets.GITHUB_TOKEN }}
160+ run : |
161+ set -euo pipefail
162+
163+ BRANCH_BASE="${{ steps.check_version.outputs.branch_base }}"
164+
165+ if [[ -z "$BRANCH_BASE" ]]; then
166+ echo "::error::Branch base not set; unable to manage labels"
167+ exit 1
168+ fi
169+
170+ declare -A COLORS=(
171+ [core]="4361ee"
172+ [cloud]="4f6ef5"
173+ )
174+
175+ for PREFIX in core cloud; do
176+ LABEL="${PREFIX}/${BRANCH_BASE}"
177+ COLOR="${COLORS[$PREFIX]}"
178+ DESCRIPTION="Backport PRs for ${PREFIX} ${BRANCH_BASE}"
179+
180+ if gh label view "$LABEL" >/dev/null 2>&1; then
181+ gh label edit "$LABEL" \
182+ --color "$COLOR" \
183+ --description "$DESCRIPTION"
184+ echo "🔄 Updated label $LABEL"
185+ else
186+ gh label create "$LABEL" \
187+ --color "$COLOR" \
188+ --description "$DESCRIPTION"
189+ echo "✨ Created label $LABEL"
190+ fi
191+ done
192+
193+ - name : Post summary
194+ if : always() && steps.check_version.outputs.is_minor_bump == 'true'
158195 run : |
159196 CURRENT_VERSION="${{ steps.check_version.outputs.current_version }}"
160197 RESULTS="${{ steps.create_branches.outputs.results }}"
You can’t perform that action at this time.
0 commit comments