|
70 | 70 | author: ${{ steps.get_author.outputs.AUTHOR }} |
71 | 71 | slugified_branch: ${{ steps.slugify_bname.outputs.stack }} |
72 | 72 | e2e_branch: ${{ steps.get_e2e_branch.outputs.branch }} |
| 73 | + chart_branch: ${{ steps.get_chart_branch.outputs.branch }} |
73 | 74 | steps: |
74 | 75 | - uses: actions/checkout@v5 |
75 | 76 |
|
@@ -141,6 +142,20 @@ jobs: |
141 | 142 | fi |
142 | 143 | echo "e2e branch name=${e2e_branch}" |
143 | 144 | echo "branch=$e2e_branch" >> $GITHUB_OUTPUT |
| 145 | + - name: Get chart branch |
| 146 | + id: get_chart_branch |
| 147 | + # ls-remote should provide list of branches. When none are found, it should be empty string. |
| 148 | + run: | |
| 149 | + chart_repo_url="https://github.com/opencrvs/infrastructure.git" |
| 150 | + if [ -n "$(git ls-remote --heads "$chart_repo_url" "refs/heads/${{ github.head_ref }}")" ]; then |
| 151 | + branch=${{ github.head_ref }} |
| 152 | + elif [ -n "$(git ls-remote --heads "$chart_repo_url" "refs/heads/${{ github.base_ref }}")" ]; then |
| 153 | + branch="${{ github.base_ref }}" |
| 154 | + else |
| 155 | + branch="develop" |
| 156 | + fi |
| 157 | + echo "chart branch name=${branch}" |
| 158 | + echo "branch=$branch" >> $GITHUB_OUTPUT |
144 | 159 | - name: Get PR Author |
145 | 160 | id: get_author |
146 | 161 | env: |
@@ -266,6 +281,7 @@ jobs: |
266 | 281 | stack: '${{ steps.generate_stack.outputs.stack }}', |
267 | 282 | 'keep-e2e': '${{ needs.generate_stack_name_and_branch.outputs.keep_e2e }}', |
268 | 283 | 'branch': '${{ needs.generate_stack_name_and_branch.outputs.e2e_branch }}', |
| 284 | + 'chart-branch': '${{ needs.generate_stack_name_and_branch.outputs.chart_branch }}', |
269 | 285 | 'runtime': '${{ needs.generate_stack_name_and_branch.outputs.runtime }}' |
270 | 286 | } |
271 | 287 | }); |
|
0 commit comments