|
51 | 51 | echo "inputs.domain='${{ inputs.domain }}' does not look like an owner/repo; skipping checkout" |
52 | 52 | shell: bash |
53 | 53 |
|
54 | | - - name: Debug: show inputs and check workspace/files |
| 54 | + - name: "Debug: show inputs and check workspace/files" |
55 | 55 | run: | |
56 | 56 | echo "DEBUG: workflow inputs" |
57 | 57 | echo " environment='${{ inputs.environment }}'" |
@@ -81,12 +81,26 @@ jobs: |
81 | 81 | fi |
82 | 82 | shell: bash |
83 | 83 |
|
84 | | - - name: Configure AWS Credentials |
85 | | - uses: NHSDigital/uec-dos-management/.github/actions/configure-credentials@latest |
| 84 | + - name: Configure AWS Credentials (assume role if available) |
| 85 | + if: ${{ secrets.AWS_ROLE_ARN != '' }} |
| 86 | + uses: aws-actions/configure-aws-credentials@v2 |
86 | 87 | with: |
87 | | - aws_account_id: ${{ secrets.ACCOUNT_ID }} |
88 | | - aws_region: ${{ vars.AWS_REGION }} |
89 | | - type: ${{ inputs.type }} |
| 88 | + role-to-assume: ${{ secrets.AWS_ROLE_ARN }} |
| 89 | + aws-region: ${{ vars.AWS_REGION }} |
| 90 | + |
| 91 | + - name: Configure AWS Credentials (fallback to access keys if role not provided) |
| 92 | + if: ${{ secrets.AWS_ROLE_ARN == '' && secrets.AWS_ACCESS_KEY_ID != '' }} |
| 93 | + uses: aws-actions/configure-aws-credentials@v2 |
| 94 | + with: |
| 95 | + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} |
| 96 | + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
| 97 | + aws-region: ${{ vars.AWS_REGION }} |
| 98 | + |
| 99 | + - name: Validate AWS credentials |
| 100 | + run: | |
| 101 | + echo "Validating AWS credentials and region" |
| 102 | + aws sts get-caller-identity --output json |
| 103 | + shell: bash |
90 | 104 |
|
91 | 105 | - name: Install awscurl (for SigV4 signing) |
92 | 106 | run: | |
|
0 commit comments