Skip to content

Commit 4204c16

Browse files
Revert "VIA-598 Allow deploy standalone job to run from main"
This reverts commit 363075a. Approach changed to patch R1 with updated workflows instead of running workflows from main so this commit is no longer required
1 parent 2bad308 commit 4204c16

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

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

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ on:
77
description: 'Environment to deploy to'
88
type: environment
99
required: true
10-
version-to-deploy:
11-
description: 'Version tag to deploy (e.g. v1.0.0)'
12-
type: string
13-
required: true
1410
release:
1511
description: 'Run assurance tests based on Hub URL for'
1612
type: choice
@@ -36,16 +32,14 @@ jobs:
3632
version: ${{ steps.variables.outputs.version }}
3733
tag: ${{ steps.variables.outputs.tag }}
3834
steps:
39-
- name: "Checkout code"
40-
uses: actions/checkout@v5
41-
- name: "Check version exists"
42-
shell: bash
35+
- name: "Check ref"
4336
run: |
44-
RELEASE_VERSION=$(git tag | grep -oP "^${{inputs.version-to-deploy}}$")
45-
if [[ -z "$RELEASE_VERSION" ]]; then
46-
echo "Invalid version number ${{inputs.version-to-deploy}} does not exist."
37+
if ${{ !startsWith(github.ref, 'refs/tags/') }}; then
38+
echo "❌ Only tagged deployments allowed."
4739
exit 1
4840
fi
41+
- name: "Checkout code"
42+
uses: actions/checkout@v5
4943
- name: "Set CI/CD variables"
5044
id: variables
5145
run: |
@@ -58,7 +52,7 @@ jobs:
5852
echo "terraform_version=$(grep "^terraform" .tool-versions | cut -f2 -d' ')" | tee -a $GITHUB_OUTPUT
5953
# TODO: Get the version, but it may not be the .version file as this should come from the CI/CD Pull Request Workflow
6054
echo "version=$(head -n 1 .version 2> /dev/null || echo unknown)" | tee -a $GITHUB_OUTPUT
61-
echo "tag=${{ inputs.version-to-deploy }}" | tee -a $GITHUB_OUTPUT
55+
echo "tag=${{ github.ref_name }}" | tee -a $GITHUB_OUTPUT
6256
- name: "List variables"
6357
run: |
6458
export BUILD_DATETIME="${{ steps.variables.outputs.build_datetime }}"

0 commit comments

Comments
 (0)