Skip to content

Commit 1344447

Browse files
committed
Harden release role name helper
1 parent 0381711 commit 1344447

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

scripts/derive-iam-role-name.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env bash
22
set -euo pipefail
3+
export LC_ALL=C
34

45
iam_role_name_max_length=64
56
iam_role_name_hash_length=8

scripts/test-derive-iam-role-name.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,20 @@ assert_output \
2828
--suffix ConductorOne-baton-axiomatic-github-enterprise-cloud \
2929
--output-name gha_artifacts_role_name
3030

31+
assert_output \
32+
"gha_artifacts_role_name=GHA-Artifacts-ConductorOne-baton-axiomatic-github-enter-571914a9" \
33+
--prefix GHA-Artifacts- \
34+
--suffix ConductorOne-baton-axiomatic-github-enterprise-cloud-extra-long-name \
35+
--output-name gha_artifacts_role_name
36+
3137
assert_output \
3238
"ecr_push_role_name=GitHubActionsECRPushRole-baton-axiomatic-github-enterprise-cloud" \
3339
--prefix GitHubActionsECRPushRole- \
3440
--suffix baton-axiomatic-github-enterprise-cloud \
3541
--output-name ecr_push_role_name
42+
43+
assert_output \
44+
"ecr_push_role_name=GitHubActionsECRPushRole-baton-axiomatic-github-enterpr-302f51c5" \
45+
--prefix GitHubActionsECRPushRole- \
46+
--suffix baton-axiomatic-github-enterprise-cloud-extra \
47+
--output-name ecr_push_role_name

0 commit comments

Comments
 (0)