@@ -67,17 +67,20 @@ jobs:
6767 - name : ' Get Origin Version Tag'
6868 id : ' origin_tag'
6969 shell : ' bash'
70+ env :
71+ ROLLBACK_ORIGIN : ' ${{ github.event.inputs.rollback_origin }}'
7072 run : |
71- TAG_VALUE="v${{ github.event.inputs.rollback_origin } }"
73+ TAG_VALUE="v${ROLLBACK_ORIGIN }"
7274 echo "ORIGIN_TAG=$TAG_VALUE" >> "$GITHUB_OUTPUT"
7375
7476 - name : ' Get Origin Commit Hash'
7577 id : ' origin_hash'
7678 env :
7779 GITHUB_TOKEN : ' ${{ secrets.GITHUB_TOKEN }}'
80+ ORIGIN_TAG : ' ${{ steps.origin_tag.outputs.ORIGIN_TAG }}'
7881 shell : ' bash'
7982 run : |
80- echo "ORIGIN_HASH=$(git rev-parse ${{ steps.origin_tag.outputs. ORIGIN_TAG }} )" >> "$GITHUB_OUTPUT"
83+ echo "ORIGIN_HASH=$(git rev-parse "${ ORIGIN_TAG}" )" >> "$GITHUB_OUTPUT"
8184
8285 - name : ' Change tag'
8386 if : " ${{ github.event.inputs.rollback_destination != '' }}"
@@ -108,9 +111,11 @@ jobs:
108111 if : " ${{ github.event.inputs.dry-run == 'false' && github.event.inputs.environment == 'prod' }}"
109112 env :
110113 NODE_AUTH_TOKEN : ' ${{ steps.cli-token.outputs.auth-token }}'
114+ PACKAGE_NAME : ' ${{ vars.CLI_PACKAGE_NAME }}'
115+ ROLLBACK_ORIGIN : ' ${{ github.event.inputs.rollback_origin }}'
111116 shell : ' bash'
112117 run : |
113- npm deprecate ${{ vars.CLI_PACKAGE_NAME }} @${{ github.event.inputs.rollback_origin }} "This version has been rolled back."
118+ npm deprecate "${PACKAGE_NAME} @${ROLLBACK_ORIGIN}" "This version has been rolled back."
114119
115120 - name : ' Get core Token'
116121 uses : ' ./.github/actions/npm-auth-token'
@@ -126,9 +131,11 @@ jobs:
126131 if : " ${{ github.event.inputs.dry-run == 'false' && github.event.inputs.environment == 'prod' }}"
127132 env :
128133 NODE_AUTH_TOKEN : ' ${{ steps.core-token.outputs.auth-token }}'
134+ PACKAGE_NAME : ' ${{ vars.CORE_PACKAGE_NAME }}'
135+ ROLLBACK_ORIGIN : ' ${{ github.event.inputs.rollback_origin }}'
129136 shell : ' bash'
130137 run : |
131- npm deprecate ${{ vars.CORE_PACKAGE_NAME }} @${{ github.event.inputs.rollback_origin }} "This version has been rolled back."
138+ npm deprecate "${PACKAGE_NAME} @${ROLLBACK_ORIGIN}" "This version has been rolled back."
132139
133140 - name : ' Get a2a Token'
134141 uses : ' ./.github/actions/npm-auth-token'
@@ -144,28 +151,31 @@ jobs:
144151 if : " ${{ github.event.inputs.dry-run == 'false' && github.event.inputs.environment == 'prod' }}"
145152 env :
146153 NODE_AUTH_TOKEN : ' ${{ steps.a2a-token.outputs.auth-token }}'
154+ PACKAGE_NAME : ' ${{ vars.A2A_PACKAGE_NAME }}'
155+ ROLLBACK_ORIGIN : ' ${{ github.event.inputs.rollback_origin }}'
147156 shell : ' bash'
148157 run : |
149- npm deprecate ${{ vars.A2A_PACKAGE_NAME }} @${{ github.event.inputs.rollback_origin }} "This version has been rolled back."
158+ npm deprecate "${PACKAGE_NAME} @${ROLLBACK_ORIGIN}" "This version has been rolled back."
150159
151160 - name : ' Delete Github Release'
152161 if : " ${{ github.event.inputs.dry-run == 'false' && github.event.inputs.environment == 'prod'}}"
153162 env :
154163 GITHUB_TOKEN : ' ${{ secrets.GITHUB_TOKEN }}'
164+ ORIGIN_TAG : ' ${{ steps.origin_tag.outputs.ORIGIN_TAG }}'
155165 shell : ' bash'
156166 run : |
157- gh release delete '${{ steps.origin_tag.outputs. ORIGIN_TAG }}' --yes
167+ gh release delete "${ ORIGIN_TAG}" --yes
158168
159169 - name : ' Verify Origin Release Deletion'
160170 if : " ${{ github.event.inputs.dry-run == 'false' }}"
161171 env :
162172 GITHUB_TOKEN : ' ${{ secrets.GITHUB_TOKEN }}'
173+ TARGET_TAG : ' ${{ steps.origin_tag.outputs.ORIGIN_TAG }}'
163174 shell : ' bash'
164175 run : |
165- TARGET_TAG="${{ steps.origin_tag.outputs.ORIGIN_TAG }}"
166176 RELEASE_TAG=$(gh release view "$TARGET_TAG" --json tagName --jq .tagName)
167177 if [ "$RELEASE_TAG" = "$TARGET_TAG" ]; then
168- echo ' ❌ Failed to delete release with tag ${{ steps.origin_tag.outputs.ORIGIN_TAG }}'
178+ echo " ❌ Failed to delete release with tag ${TARGET_TAG}"
169179 echo '❌ This means the release was not deleted, and the workflow should fail.'
170180 exit 1
171181 fi
@@ -175,21 +185,22 @@ jobs:
175185 if : " ${{ github.event.inputs.dry-run == 'false' }}"
176186 env :
177187 GITHUB_TOKEN : ' ${{ secrets.GITHUB_TOKEN }}'
188+ ROLLBACK_TAG_NAME : ' ${{ steps.origin_tag.outputs.ORIGIN_TAG }}-rollback'
189+ ORIGIN_HASH : ' ${{ steps.origin_hash.outputs.ORIGIN_HASH }}'
178190 shell : ' bash'
179191 run : |
180- ROLLBACK_TAG_NAME="${{ steps.origin_tag.outputs.ORIGIN_TAG }}-rollback"
181192 echo "ROLLBACK_TAG=$ROLLBACK_TAG_NAME" >> "$GITHUB_OUTPUT"
182- git tag "$ROLLBACK_TAG_NAME" "${{ steps.origin_hash.outputs. ORIGIN_HASH } }"
193+ git tag "$ROLLBACK_TAG_NAME" "${ORIGIN_HASH}"
183194 git push origin --tags
184195
185196 - name : ' Verify Rollback Tag Added'
186197 if : " ${{ github.event.inputs.dry-run == 'false' }}"
187198 env :
188199 GITHUB_TOKEN : ' ${{ secrets.GITHUB_TOKEN }}'
200+ TARGET_TAG : ' ${{ steps.rollback_tag.outputs.ROLLBACK_TAG }}'
201+ TARGET_HASH : ' ${{ steps.origin_hash.outputs.ORIGIN_HASH }}'
189202 shell : ' bash'
190203 run : |
191- TARGET_TAG="${{ steps.rollback_tag.outputs.ROLLBACK_TAG }}"
192- TARGET_HASH="${{ steps.origin_hash.outputs.ORIGIN_HASH }}"
193204 ROLLBACK_COMMIT=$(git rev-parse -q --verify "$TARGET_TAG")
194205 if [ "$ROLLBACK_COMMIT" != "$TARGET_HASH" ]; then
195206 echo '❌ Failed to add tag $TARGET_TAG to commit $TARGET_HASH'
@@ -199,21 +210,32 @@ jobs:
199210
200211 - name : ' Log Dry run'
201212 if : " ${{ github.event.inputs.dry-run == 'true' }}"
213+ env :
214+ ROLLBACK_ORIGIN : ' ${{ github.event.inputs.rollback_origin }}'
215+ ROLLBACK_DESTINATION : ' ${{ github.event.inputs.rollback_destination }}'
216+ CHANNEL : ' ${{ github.event.inputs.channel }}'
217+ REF_INPUT : ' ${{ github.event.inputs.ref }}'
218+ ORIGIN_TAG : ' ${{ steps.origin_tag.outputs.ORIGIN_TAG }}'
219+ ORIGIN_HASH : ' ${{ steps.origin_hash.outputs.ORIGIN_HASH }}'
220+ ROLLBACK_TAG : ' ${{ steps.rollback_tag.outputs.ROLLBACK_TAG }}'
221+ CLI_PACKAGE_NAME : ' ${{ vars.CLI_PACKAGE_NAME }}'
222+ CORE_PACKAGE_NAME : ' ${{ vars.CORE_PACKAGE_NAME }}'
223+ A2A_PACKAGE_NAME : ' ${{ vars.A2A_PACKAGE_NAME }}'
202224 shell : ' bash'
203225 run : |
204226 echo "
205227 Inputs:
206- - rollback_origin: '${{ github.event.inputs.rollback_origin } }'
207- - rollback_destination: '${{ github.event.inputs.rollback_destination } }'
208- - channel: '${{ github.event.inputs.channel } }'
209- - ref: '${{ github.event.inputs.ref } }'
228+ - rollback_origin: '${ROLLBACK_ORIGIN }'
229+ - rollback_destination: '${ROLLBACK_DESTINATION }'
230+ - channel: '${CHANNEL }'
231+ - ref: '${REF_INPUT }'
210232
211233 Outputs:
212- - ORIGIN_TAG: '${{ steps.origin_tag.outputs. ORIGIN_TAG } }'
213- - ORIGIN_HASH: '${{ steps.origin_hash.outputs. ORIGIN_HASH } }'
214- - ROLLBACK_TAG: '${{ steps.rollback_tag.outputs. ROLLBACK_TAG } }'
234+ - ORIGIN_TAG: '${ORIGIN_TAG}'
235+ - ORIGIN_HASH: '${ORIGIN_HASH}'
236+ - ROLLBACK_TAG: '${ROLLBACK_TAG}'
215237
216- Would have npm deprecate ${{vars. CLI_PACKAGE_NAME}} @${{ github.event.inputs.rollback_origin }} , ${{vars. CORE_PACKAGE_NAME}} @${{ github.event.inputs.rollback_origin }} , and ${{ vars. A2A_PACKAGE_NAME }} @${{ github.event.inputs.rollback_origin } }
217- Would have deleted the github release with tag ${{ steps.origin_tag.outputs. ORIGIN_TAG } }
218- Would have added tag ${{ steps.origin_tag.outputs. ORIGIN_TAG }} -rollback to ${{ steps.origin_hash.outputs. ORIGIN_HASH } }
238+ Would have npm deprecate ${CLI_PACKAGE_NAME}@${ROLLBACK_ORIGIN} , ${CORE_PACKAGE_NAME}@${ROLLBACK_ORIGIN} , and ${A2A_PACKAGE_NAME} @${ROLLBACK_ORIGIN }
239+ Would have deleted the github release with tag ${ORIGIN_TAG}
240+ Would have added tag ${ORIGIN_TAG} -rollback to ${ORIGIN_HASH}
219241 "
0 commit comments