Skip to content

Commit faffd7c

Browse files
committed
[NRL-793] Add config to skip version checks (useful for debugging and testing)
1 parent 00dd7d7 commit faffd7c

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

.github/workflows/update-lambda-permissions.yml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,20 @@ on:
1111
type: environment
1212

1313
stack_name:
14-
description: Name of stack to apply permissions to
14+
description: Stack to update
1515
required: true
1616
type: string
1717

1818
branch_name:
1919
description: Branch to deploy
2020
required: true
2121

22+
strict_versioning:
23+
description: Use strict versioning (recommended)
24+
required: true
25+
type: boolean
26+
default: true
27+
2228
permissions:
2329
id-token: write
2430
contents: read
@@ -72,12 +78,17 @@ jobs:
7278
this_version="$(./scripts/get-current-info.sh | jq -r .version)"
7379
deployed_version="$(terraform -chdir=terraform/infrastructure output --raw version)"
7480
75-
if [ "${deployed_version}" != "${this_version}" ]; then
76-
echo "Deployed version is ${deployed_version}, not ${this_version}"
77-
#exit 1
78-
fi
81+
echo "code-version=${this_version} deployed-version=${deployed_version}"
7982
80-
echo "Deployed version matches this version: ${deployed_version}"
83+
if [ "${deployed_version}" != "${this_version}" ]
84+
then
85+
echo "${this_version} does not match deployed version: ${deployed_version}" 1>&2
86+
87+
if [ "${{ inputs.strict_versioning }}" == "true" ]; then
88+
echo "Strict version checking failed, cancelling workflow" 1>&2
89+
exit 1
90+
fi
91+
fi
8192
8293
build-permissions:
8394
name: Build permissions

0 commit comments

Comments
 (0)