aws-actions / configure-aws-credentials

Configure AWS credential environment variables for use in other GitHub Actions.
MIT License
2.41k stars 465 forks source link

unset-current-credentials does not fully unset AWS_* env variables #1094

Closed runlevel5 closed 2 months ago

runlevel5 commented 2 months ago

Describe the bug

Well we could clearly see that unset-current-credentials was added which basically just set AWS_* environment variable to empty string. And it is NOT enough to completely purge the AWS session which lead to the error in which the last session is still be used.

Expected Behavior

All AWS_* environment variables get UNSET fully.

Current Behavior

All AWS_* environment variables are NOT unset and basically set to empty string.

Reproduction Steps

      - name: Configure AWS credentials
        id: step1
        uses: aws-actions/configure-aws-credentials
        with:
          aws-region: ap-southeast-2
          role-to-assume: "arn:aws:iam::XXXXXXX:role/roleName1"
      - name: Do something with AWS
         id: step2
         run: echo "Hello world"
      - name: Configure AWS credentials (different role)
        id: step3
        uses: aws-actions/configure-aws-credentials
        with:
          aws-region: ap-southeast-2
          role-to-assume: "arn:aws:iam::XXXXXXX:role/roleName2"     
          unset-current-credentials: true
      - name: Do something with AWS
        id: step4
        run: aws s3 something something

The 4th would still use AWS_ vars of the 1st step unfortunately

Possible Solution

I do not know if there are any way because AFAIK @actions/core does not provide any API to unset variables

Additional Information/Context

No response

runlevel5 commented 2 months ago

Sorry, I was wrong. I was using an old version in which unset-current-credentials was not yet introduced. After trying out the latest version, everything works

github-actions[bot] commented 2 months ago

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one.