Coder Social home page Coder Social logo

Comments (2)

clareliguori avatar clareliguori commented on July 30, 2024

Hi @nicolaevladescu , I don't know the order of precedence that GitHub Actions follows for setting env variables in Docker actions (I can't find it documented anywhere), but it appears that env vars set in the workflow's environment override values in the action's env settings based on what you are seeing. It would be a good question for you to ask in the GitHub Actions forum.

Do you see the same behavior for any kind of environment variable, not just ones set by this action? For example, does "bar" take precedence over both "foo" and "baz" below?

jobs:
  job1:
    env:
      AWS_ACCESS_KEY_ID: "foo"
    steps:
    - run: |
       echo "::set-env name=AWS_ACCESS_KEY_ID::bar"
    - uses: <<your action>>
      with:
        aws_key: "baz"

With respect to resetting the environment variables, individual GitHub Action jobs each have a fresh environment, so you can do:

jobs:
  job1:
    runs-on: ubuntu-latest
    steps:
    - uses: aws-actions/configure-aws-credentials@v1
      with:
        aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
        aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
        aws-region: us-east-2
  job2:
    runs-on: ubuntu-latest
    steps:
    - uses: <<your action>>
      with:
        aws_key: ${{ secrets.ANOTHER_AWS_ACCESS_KEY_ID }}
        aws_secret: ${{ secrets.ANOTHER_AWS_SECRET_ACCESS_KEY }}
        aws_region: us-east-2

from configure-aws-credentials.

nicolaevladescu avatar nicolaevladescu commented on July 30, 2024

Hi.

Thank you for the suggestions, yeah it seems it's out of the control of this action. I will try to find out the precedence from GitHub.

Thanks for the feedback!

from configure-aws-credentials.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.