@@ -204,6 +204,19 @@ jobs:
204204 ref : ${{ needs.determine-workflows-ref.outputs.ref }}
205205 persist-credentials : false
206206
207+ - name : Derive AWS role names
208+ id : role-names
209+ working-directory : _workflows
210+ shell : bash
211+ env :
212+ REPO_OWNER : ${{ github.event.repository.owner.login }}
213+ REPO_NAME : ${{ github.event.repository.name }}
214+ run : |
215+ bash ./scripts/derive-iam-role-name.sh \
216+ --prefix GHA-Artifacts- \
217+ --suffix "${REPO_OWNER}-${REPO_NAME}" \
218+ --output-name gha_artifacts_role_name >> "$GITHUB_OUTPUT"
219+
207220 - name : Set up Go for caller
208221 uses : actions/setup-go@v6
209222 with :
@@ -256,7 +269,7 @@ jobs:
256269 - name : Configure AWS credentials via OIDC
257270 uses : aws-actions/configure-aws-credentials@v5
258271 with :
259- role-to-assume : arn:aws:iam::025044153841:role/GHA-Artifacts- ${{ github.event.repository.owner.login }}-${{ github.event.repository.name }}
272+ role-to-assume : arn:aws:iam::025044153841:role/${{ steps.role-names.outputs.gha_artifacts_role_name }}
260273 aws-region : us-west-2
261274
262275 - name : Run GoReleaser
@@ -472,6 +485,19 @@ jobs:
472485 ref : ${{ needs.determine-workflows-ref.outputs.ref }}
473486 persist-credentials : false
474487
488+ - name : Derive AWS role names
489+ id : role-names
490+ working-directory : _workflows
491+ shell : bash
492+ env :
493+ REPO_OWNER : ${{ github.event.repository.owner.login }}
494+ REPO_NAME : ${{ github.event.repository.name }}
495+ run : |
496+ bash ./scripts/derive-iam-role-name.sh \
497+ --prefix GHA-Artifacts- \
498+ --suffix "${REPO_OWNER}-${REPO_NAME}" \
499+ --output-name gha_artifacts_role_name >> "$GITHUB_OUTPUT"
500+
475501 - name : Set up Go for caller
476502 uses : actions/setup-go@v6
477503 with :
@@ -639,7 +665,7 @@ jobs:
639665 - name : Configure AWS credentials via OIDC
640666 uses : aws-actions/configure-aws-credentials@v5
641667 with :
642- role-to-assume : arn:aws:iam::025044153841:role/GHA-Artifacts- ${{ github.event.repository.owner.login }}-${{ github.event.repository.name }}
668+ role-to-assume : arn:aws:iam::025044153841:role/${{ steps.role-names.outputs.gha_artifacts_role_name }}
643669 aws-region : us-west-2
644670
645671 - name : Calculate S3 directory
@@ -781,6 +807,24 @@ jobs:
781807 ref : ${{ needs.determine-workflows-ref.outputs.ref }}
782808 persist-credentials : false
783809
810+ - name : Derive AWS role names
811+ id : role-names
812+ if : inputs.docker == true || inputs.lambda == true
813+ working-directory : _workflows
814+ shell : bash
815+ env :
816+ REPO_OWNER : ${{ github.event.repository.owner.login }}
817+ REPO_NAME : ${{ github.event.repository.name }}
818+ run : |
819+ bash ./scripts/derive-iam-role-name.sh \
820+ --prefix GHA-Artifacts- \
821+ --suffix "${REPO_OWNER}-${REPO_NAME}" \
822+ --output-name gha_artifacts_role_name >> "$GITHUB_OUTPUT"
823+ bash ./scripts/derive-iam-role-name.sh \
824+ --prefix GitHubActionsECRPushRole- \
825+ --suffix "${REPO_NAME}" \
826+ --output-name ecr_push_role_name >> "$GITHUB_OUTPUT"
827+
784828 - name : Set up Go for caller
785829 if : inputs.docker == true || inputs.lambda == true
786830 uses : actions/setup-go@v6
@@ -875,7 +919,7 @@ jobs:
875919 if : inputs.docker == true
876920 uses : aws-actions/configure-aws-credentials@v5
877921 with :
878- role-to-assume : arn:aws:iam::025044153841:role/GHA-Artifacts- ${{ github.event.repository.owner.login }}-${{ github.event.repository.name }}
922+ role-to-assume : arn:aws:iam::025044153841:role/${{ steps.role-names.outputs.gha_artifacts_role_name }}
879923 aws-region : us-east-1
880924
881925 - name : Login to Public ECR
@@ -899,7 +943,7 @@ jobs:
899943 if : inputs.lambda == true
900944 uses : aws-actions/configure-aws-credentials@v5
901945 with :
902- role-to-assume : " arn:aws:iam::168442440833:role/GitHubActionsECRPushRole- ${{ github.event.repository.name }}"
946+ role-to-assume : " arn:aws:iam::168442440833:role/${{ steps.role-names.outputs.ecr_push_role_name }}"
903947 aws-region : us-west-2
904948
905949 - name : Login to Lambda ECR
@@ -1015,6 +1059,19 @@ jobs:
10151059 ref : ${{ needs.determine-workflows-ref.outputs.ref }}
10161060 persist-credentials : false
10171061
1062+ - name : Derive AWS role names
1063+ id : role-names
1064+ working-directory : _workflows
1065+ shell : bash
1066+ env :
1067+ REPO_OWNER : ${{ github.event.repository.owner.login }}
1068+ REPO_NAME : ${{ github.event.repository.name }}
1069+ run : |
1070+ bash ./scripts/derive-iam-role-name.sh \
1071+ --prefix GHA-Artifacts- \
1072+ --suffix "${REPO_OWNER}-${REPO_NAME}" \
1073+ --output-name gha_artifacts_role_name >> "$GITHUB_OUTPUT"
1074+
10181075 - name : Set up Go for workflows
10191076 uses : actions/setup-go@v6
10201077 with :
@@ -1042,7 +1099,7 @@ jobs:
10421099 - name : Configure AWS credentials via OIDC
10431100 uses : aws-actions/configure-aws-credentials@v5
10441101 with :
1045- role-to-assume : arn:aws:iam::025044153841:role/GHA-Artifacts- ${{ github.event.repository.owner.login }}-${{ github.event.repository.name }}
1102+ role-to-assume : arn:aws:iam::025044153841:role/${{ steps.role-names.outputs.gha_artifacts_role_name }}
10461103 aws-region : us-west-2
10471104
10481105 - name : Create unified checksums file
0 commit comments