Skip to content

Commit 98dd85d

Browse files
Merge pull request #713 from NHSDigital/feature/made14-NRL-793-perms-pipeline-fixups
[NRL-793] Use tag for current-info version if branch is HEAD
2 parents 072f141 + ca59e17 commit 98dd85d

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Update Lambda Permissions
2-
run-name: Updating permissions on ${{ inputs.stack_name }} using ${{ github.ref }} by ${{ github.actor }}
2+
run-name: Updating permissions on ${{ inputs.stack_name }} using ${{ github.ref_name }} by ${{ github.actor }}
33

44
on:
55
workflow_dispatch:

scripts/get-current-info.sh

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,20 @@
33
set -o errexit -o nounset -o pipefail
44

55
BRANCH_NAME="$(git rev-parse --abbrev-ref HEAD)"
6+
TAG_NAME="$(git describe --tags || echo "no-tags")"
67
SHORT_COMMIT_HASH="$(git rev-parse --short=8 HEAD)"
78

8-
echo "{ \"version\": \"${BRANCH_NAME}@${SHORT_COMMIT_HASH}\" }"
9+
if [ "${BRANCH_NAME}" == "HEAD" ]; then
10+
NRLF_VERSION="${TAG_NAME}@${SHORT_COMMIT_HASH}"
11+
else
12+
NRLF_VERSION="${BRANCH_NAME}@${SHORT_COMMIT_HASH}"
13+
fi
14+
15+
cat << EOF
16+
{
17+
"version": "${NRLF_VERSION}",
18+
"tag": "${TAG_NAME}",
19+
"branch": "${BRANCH_NAME}",
20+
"commit": "${SHORT_COMMIT_HASH}"
21+
}
22+
EOF

terraform/bootstrap/non-mgmt/terraform-trust-policy.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"Principal": {
77
"AWS": "arn:aws:iam::REPLACEME:root"
88
},
9-
"Action": "sts:AssumeRole",
9+
"Action": ["sts:AssumeRole", "sts:TagSession"],
1010
"Condition": {}
1111
}
1212
]

0 commit comments

Comments
 (0)