Skip to content

Commit d01ea1d

Browse files
authored
(ELI-444) reverting to original behaviour (#340)
1 parent 97c2c4f commit d01ea1d

File tree

2 files changed

+11
-17
lines changed

2 files changed

+11
-17
lines changed

.github/workflows/cicd-2-publish.yaml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff 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

.github/workflows/cicd-3-test_auto.yaml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
name: "Auto Deploy to test"
22

33
on:
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

108
concurrency:
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
@@ -38,7 +41,7 @@ jobs:
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
@@ -59,7 +62,7 @@ jobs:
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

0 commit comments

Comments
 (0)