title: How AWS Credentials works at GitHub Actions?
body: <p>At my unit tests, I'm using <code>aws-sdk</code> to test the SES, which needs some credentials, we are facing a problem to access the secrets with GitHub Actions.</p>
  
  <p>At beginning I was trying to set the values to <code>~/.aws/credentials</code> using the run command from github workflows:</p>
  
  <pre><code># .github/workflows/nodejs.yml
  steps:
    ...
    - name: Unit Test
      run: |
        mkdir -p ~/.aws
        touch ~/.aws/credentials
  
        echo "[default]
        aws_access_key_id = ${{ secrets.AWS_ACCESS_KEY_ID }}
        aws_secret_access_key = ${{ secrets.AWS_SECRET_KEY_ID }}
        region = ${AWS_DEFAULT_REGION}
  
        [github]
        role_arn = arn:aws:iam::{accountID}:role/{role}
        source_profile = default" &gt; ~/.aws/credentials 
  
        npm test
      env:
        AWS_DEFAULT_REGION: us-east-1
        CI: true
  </code></pre>
  
  <p>Originally my test file:</p>
  
  <pre class="lang-js prettyprint-override"><code>// ses.test.js
  const AWS = require("aws-sdk")
  const credentials = new AWS.SharedIniFileCredentials({ profile: "github" })
  AWS.config.update({ credentials })
  ...
  </code></pre>
  
  <p>I tried to use another way to get credentials at my tests like, and also doesn't work:</p>
  
  <pre class="lang-js prettyprint-override"><code>const AWS = require("aws-sdk")
  const credentials = new AWS.ChainableTemporaryCredentials({
    params: {RoleArn: "arn:aws:iam::{accountID}:role/{role}"},
    masterCredentials: new AWS.EnvironmentCredentials("AWS")
  )}
  
  AWS.config.update({ credentials })
  </code></pre>
  
  <p>Finally I tried to create an Action customized (using actions js library like: @actions/core, @actions/io, @actions/exec), to get the AWS env values and set it at <code>~/.aws/credentials</code>, but also doesn't work as expected</p>
  
  <p>One way that worked was exposing AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY (without use GitHub Actions secrets, not ideal, for security purposes)</p>
  
  <p>Someone has any ideas how AWS credentials could work at GitHub Actions with secrets ?</p>
  
  <p>Thanks a lot for your attention.</p>