Skip to content

AWS_REGION not updated when configure-aws-credentials is called multiple times in v4.2.0 #1354

@hozzer

Description

@hozzer

Describe the bug

When using aws-actions/[email protected] multiple times in a workflow with different regions, the AWS_REGION environment variable is not updated on subsequent calls. This worked correctly in v4.1.0.

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

(Based on code snippet)
After first configuration: AWS_REGION=eu-west-2
After second configuration: AWS_REGION=ap-southeast-1

Current Behavior

(Based on code snippet)
After first configuration: AWS_REGION=eu-west-2
After second configuration: AWS_REGION=eu-west-2

Reproduction Steps

on:
  workflow_dispatch:

permissions:
  id-token: write

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - name: Configure AWS - Region 1
        uses: aws-actions/[email protected]
        with:
          role-to-assume: arn:aws:iam::123456789012:role/test-role
          aws-region: eu-west-2

      - name: Check Region 1
        run: echo "AWS_REGION=$AWS_REGION"

      - name: Configure AWS - Region 2
        uses: aws-actions/[email protected]
        with:
          role-to-assume: arn:aws:iam::123456789012:role/test-role
          aws-region: ap-southeast-1

      - name: Check Region 2
        run: |
          echo "AWS_REGION=$AWS_REGION"

Possible Solution

No response

Additional Information/Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingp1potential-regressionMarking this issue as a potential regression to be checked by team member

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions