File tree Expand file tree Collapse file tree 2 files changed +11
-17
lines changed
Expand file tree Collapse file tree 2 files changed +11
-17
lines changed Original file line number Diff line number Diff line change @@ -129,12 +129,3 @@ jobs:
129129 Author: "${{ github.actor }}"
130130 title: "Pushed to main"
131131 version: "${{ needs.metadata.outputs.version }}"
132-
133- call-deploy-test :
134- name : " Trigger TEST deploy (only on success)"
135- needs : publish
136- if : ${{ needs.publish.result == 'success' && github.ref == 'refs/heads/main' }}
137- uses : ./.github/workflows/cicd-3-test_auto.yaml
138- with :
139- ref : ${{ github.sha }}
140- secrets : inherit
Original file line number Diff line number Diff line change 11name : " Auto Deploy to test"
22
33on :
4- workflow_call :
5- inputs :
6- ref :
7- required : true
8- type : string
4+ workflow_run :
5+ workflows : ["CI/CD publish"]
6+ types : [completed]
97
108concurrency :
119 group : terraform-deploy-test
@@ -20,14 +18,19 @@ jobs:
2018 metadata :
2119 name : " Resolve metadata from triggering run"
2220 runs-on : ubuntu-latest
21+ if : >
22+ ${{
23+ github.event.workflow_run.conclusion == 'success' &&
24+ github.event.workflow_run.head_branch == 'main'
25+ }}
2326 outputs :
2427 terraform_version : ${{ steps.vars.outputs.terraform_version }}
2528 tag : ${{ steps.tag.outputs.name }}
2629 steps :
2730 - name : " Checkout exact commit from CI/CD publish"
2831 uses : actions/checkout@v5
2932 with :
30- ref : ${{ inputs.ref }}
33+ ref : ${{ github.event.workflow_run.head_sha }}
3134
3235 - name : " Set CI/CD variables"
3336 id : vars
3841 id : tag
3942 run : |
4043 git fetch --tags --force
41- SHA="${{ inputs.ref }}"
44+ SHA="${{ github.event.workflow_run.head_sha }}"
4245 TAG=$(git tag --points-at "$SHA" | grep '^dev-' | head -n1 || true)
4346 if [ -z "$TAG" ]; then
4447 echo "No dev-* tag found on $SHA" >&2
5962 - name : " Checkout same commit"
6063 uses : actions/checkout@v5
6164 with :
62- ref : ${{ inputs.ref }}
65+ ref : ${{ github.event.workflow_run.head_sha }}
6366
6467 - name : " Setup Terraform"
6568 uses : hashicorp/setup-terraform@v3
You can’t perform that action at this time.
0 commit comments