File tree Expand file tree Collapse file tree 3 files changed +10
-6
lines changed Expand file tree Collapse file tree 3 files changed +10
-6
lines changed Original file line number Diff line number Diff line change 44
44
- none
45
45
default : all
46
46
47
+ env :
48
+ account_id : ${{ inputs.environment == 'production' && '820242920762' || '393416225559' }}
49
+
47
50
jobs :
48
51
validate-inputs :
49
52
runs-on : ubuntu-latest
@@ -94,13 +97,13 @@ jobs:
94
97
- name : Configure AWS Credentials
95
98
uses : aws-actions/configure-aws-credentials@v4
96
99
with :
97
- role-to-assume : ${{ env.aws_role }}
100
+ role-to-assume : arn:aws:iam:: ${{ env.account_id }}:role/GithubDeployMavisAndInfrastructure
98
101
aws-region : eu-west-2
99
102
- name : Compare permissions
100
103
id : compare-permissions
101
104
run : |
102
105
source ./scripts/validate-github-actions-policy.sh
103
- validate_policies arn:aws:iam::${{ env.aws_account_id }}:policy/DeployMavisResources ./resources/github_actions_policy.json
106
+ validate_policies arn:aws:iam::${{ env.account_id }}:policy/DeployMavisResources ./resources/github_actions_policy.json
104
107
exit $?
105
108
update-permissions :
106
109
runs-on : ubuntu-latest
@@ -120,10 +123,10 @@ jobs:
120
123
- name : Configure AWS Credentials
121
124
uses : aws-actions/configure-aws-credentials@v4
122
125
with :
123
- role-to-assume : ${{ env.aws_role }}
126
+ role-to-assume : arn:aws:iam:: ${{ env.account_id }}:role/GithubDeployMavisAndInfrastructure
124
127
aws-region : eu-west-2
125
128
- name : Update IAM policy
126
- run : ./scripts/update-github-actions-policy.sh arn:aws:iam::${{ env.aws_account_id }}:policy/DeployMavisResources ./resources/github_actions_policy.json
129
+ run : ./scripts/update-github-actions-policy.sh arn:aws:iam::${{ env.account_id }}:policy/DeployMavisResources ./resources/github_actions_policy.json
127
130
deploy-infrastructure :
128
131
permissions :
129
132
id-token : write
Original file line number Diff line number Diff line change 123
123
" secretsmanager:UpdateSecret" ,
124
124
" ssm:DeleteParameter" ,
125
125
" ssm:DeleteParameters" ,
126
- " ssm:PutParameter"
126
+ " ssm:PutParameter" ,
127
+ " ssm:GetParameter"
127
128
],
128
129
"Resource" : [" *" ]
129
130
}
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ function validate_policies() {
15
15
jq -S . deployed_policy.json > deployed_policy_sorted.json
16
16
jq -S . " $POLICY_FILE " > github_actions_policy_sorted.json
17
17
18
- POLICY_DIFF=$( diff --unified deployed_policy_sorted.json github_actions_policy_sorted.json)
18
+ POLICY_DIFF=$( diff --unified deployed_policy_sorted.json github_actions_policy_sorted.json) || true
19
19
if [ -n " $POLICY_DIFF " ]; then
20
20
echo " Policy mismatch detected: $POLICY_DIFF "
21
21
return 1
You can’t perform that action at this time.
0 commit comments