Skip to content

Commit a19f9c0

Browse files
authored
Merge pull request #5413 from 3drepo/ISSUE_5403
ISSUE 5403 - Better handle destroy for issue-xxx and text only branch names
2 parents c022b9d + 10d8dd3 commit a19f9c0

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

.github/workflows/onPRClose.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,16 @@ jobs:
5050
destroy-deployed-branch:
5151
name: Call Azure Destroy Pipeline
5252
runs-on: ubuntu-latest
53-
needs: get-details
5453
steps:
54+
- name: Set branch name to destroy
55+
run: |
56+
echo 'chartName='$( echo ${{ github.head_ref || github.ref_name }} | sed "s/_/-/" | awk '{print tolower($0)}' ) >> "$GITHUB_OUTPUT"
57+
id: getChartName
5558
- name: Azure Pipelines Action
56-
if: needs.get-details.outputs.issue-number
59+
if: ${{ (steps.getChartName.outputs.chartName != 'staging') && (steps.getChartName.outputs.chartName != 'master') }}
5760
uses: Azure/[email protected]
5861
with:
5962
azure-devops-project-url: https://dev.azure.com/3drepo/3drepo.io
6063
azure-pipeline-name: 'destroy'
6164
azure-devops-token: ${{ secrets.AZURE_DEVOPS_TOKEN }}
62-
azure-pipeline-variables: '{"branchName": "issue-${{ needs.get-details.outputs.issue-number }}"}'
65+
azure-pipeline-variables: '{"branchName": "${{ steps.getChartName.outputs.chartName }}"}'

0 commit comments

Comments
 (0)