@@ -40,11 +40,10 @@ jobs:
4040 GITLAB_TOKEN : ${{ secrets.GITLAB_TOKEN }}
4141 run : |
4242 # Determine branch from webhook or manual input
43- if [ "${{ github.event_name }}" = "repository_dispatch" ]; then
44- BRANCH_REF="${{ github.event.client_payload.ref || 'refs/heads/enterprise' }}"
45- BRANCH=$(echo "$BRANCH_REF" | sed 's|refs/heads/||')
46- else
47- BRANCH="${{ github.event.inputs.gitlab_branch || 'enterprise' }}"
43+ BRANCH="${{ github.event_name == 'repository_dispatch' && github.event.client_payload.ref || github.event.inputs.gitlab_branch || 'enterprise' }}"
44+ BRANCH=$(echo "$BRANCH" | sed 's|refs/heads/||')
45+ if [ "$BRANCH" = "null" ]; then
46+ BRANCH="enterprise"
4847 fi
4948
5049 echo "Cloning branch: $BRANCH"
@@ -178,11 +177,10 @@ jobs:
178177 GITLAB_TOKEN : ${{ secrets.GITLAB_TOKEN }}
179178 run : |
180179 # Determine branch from webhook or manual input
181- if [ "${{ github.event_name }}" = "repository_dispatch" ]; then
182- BRANCH_REF="${{ github.event.client_payload.ref || 'refs/heads/enterprise' }}"
183- BRANCH=$(echo "$BRANCH_REF" | sed 's|refs/heads/||')
184- else
185- BRANCH="${{ github.event.inputs.gitlab_branch || 'enterprise' }}"
180+ BRANCH="${{ github.event_name == 'repository_dispatch' && github.event.client_payload.ref || github.event.inputs.gitlab_branch || 'enterprise' }}"
181+ BRANCH=$(echo "$BRANCH" | sed 's|refs/heads/||')
182+ if [ "$BRANCH" = "null" ]; then
183+ BRANCH="enterprise"
186184 fi
187185
188186 echo "Cloning branch: $BRANCH"
@@ -265,11 +263,10 @@ jobs:
265263 GITLAB_TOKEN : ${{ secrets.GITLAB_TOKEN }}
266264 run : |
267265 # Determine branch from webhook or manual input
268- if [ "${{ github.event_name }}" = "repository_dispatch" ]; then
269- BRANCH_REF="${{ github.event.client_payload.ref || 'refs/heads/enterprise' }}"
270- BRANCH=$(echo "$BRANCH_REF" | sed 's|refs/heads/||')
271- else
272- BRANCH="${{ github.event.inputs.gitlab_branch || 'enterprise' }}"
266+ BRANCH="${{ github.event_name == 'repository_dispatch' && github.event.client_payload.ref || github.event.inputs.gitlab_branch || 'enterprise' }}"
267+ BRANCH=$(echo "$BRANCH" | sed 's|refs/heads/||')
268+ if [ "$BRANCH" = "null" ]; then
269+ BRANCH="enterprise"
273270 fi
274271
275272 echo "Cloning branch: $BRANCH"
@@ -349,11 +346,10 @@ jobs:
349346 GITLAB_TOKEN : ${{ secrets.GITLAB_TOKEN }}
350347 run : |
351348 # Determine branch from webhook or manual input
352- if [ "${{ github.event_name }}" = "repository_dispatch" ]; then
353- BRANCH_REF="${{ github.event.client_payload.ref || 'refs/heads/enterprise' }}"
354- BRANCH=$(echo "$BRANCH_REF" | sed 's|refs/heads/||')
355- else
356- BRANCH="${{ github.event.inputs.gitlab_branch || 'enterprise' }}"
349+ BRANCH="${{ github.event_name == 'repository_dispatch' && github.event.client_payload.ref || github.event.inputs.gitlab_branch || 'enterprise' }}"
350+ BRANCH=$(echo "$BRANCH" | sed 's|refs/heads/||')
351+ if [ "$BRANCH" = "null" ]; then
352+ BRANCH="enterprise"
357353 fi
358354
359355 echo "Cloning branch: $BRANCH"
0 commit comments