Skip to content

Commit a4ee120

Browse files
committed
zdas
1 parent d2335b2 commit a4ee120

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

.github/workflows/promote-branch.yml

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,8 @@ jobs:
3030
name: 'Validate promotion'
3131
runs-on: ubuntu-latest
3232
steps:
33-
- name: 'Read env variables'
34-
run: |
35-
echo "isdevelopment-branch=${{ env.is-development-branch }}"
36-
echo "is-maintenance-branch=${{ env.is-maintenance-branch }}"
37-
echo "promotion-type=${{ inputs.promotion-type }}"
38-
echo "${{ github.ref_name }}"
33+
- name: 'Checkout ${{ github.head_ref || github.ref }}'
34+
uses: actions/checkout@v4
3935
- name: 'Check promotion type'
4036
if: ${{ (inputs.promotion-type != 'release') && (inputs.promotion-type != 'preview') }}
4137
run: |
@@ -46,3 +42,20 @@ jobs:
4642
run: |
4743
echo "Invalid source branch: ${{ github.ref_name }}"
4844
exit 1
45+
- name: 'Determine versions'
46+
uses: ./.github/actions/determine-version
47+
id: determine-version
48+
with:
49+
config-file-path: './.gitversion/version.yml'
50+
run-number: ${{ github.run-number }}
51+
- name: 'Validate target branch'
52+
run: |
53+
if [[ "${{ inputs.promotion-type }}" == "preview" ]]; then
54+
target_branch="preview/${{ steps.determine-version.outputs.friendly-version }}"
55+
else
56+
target_branch="release/${{ steps.determine-version.outputs.friendly-version }}"
57+
fi
58+
59+
echo "Target branch: $target_branch"
60+
61+
git ls-remote --exit-code --heads refs/heads/$target_branch

0 commit comments

Comments
 (0)