We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 69ad409 commit 04a9d34Copy full SHA for 04a9d34
.github/workflows/promote-branch.yml
@@ -61,6 +61,8 @@ jobs:
61
echo "Invalid source branch: ${{ github.ref_name }}"
62
exit 1
63
- name: 'Validate target branch'
64
+ env:
65
+ target-branch: ''
66
run: |
67
if [[ "${{ inputs.promotion-type }}" == "preview" ]]; then
68
echo "target-branch=preview/${{ needs.versioning.outputs.friendly-version }}" >> $GITHUB_ENV
@@ -71,3 +73,8 @@ jobs:
71
73
echo "Target branch: ${{ env.target-branch }}"
72
74
75
git ls-remote --exit-code --heads origin ${{ env.target-branch }}
76
+
77
+ if [[ $? -ne 0 ]]; then
78
+ echo "Target branch does not exist: ${{ env.target-branch }}"
79
+ exit 1
80
+ fi
0 commit comments