Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 3
Message 1 of 3

Env variables in uses

Solved! Go to Solution.

It would be nice to be able to use enviornmental variables in a uses varaible. This will allow for easy changing of versions for actions such as checkout.

 

name: svt-av1
on: [push, pull_request]
env:
  checkout: 'actions/checkout@v2

jobs:
  build:
    runs-on: ubuntu-18.04
    steps:
    - uses: ${{ env.checkout }}
      with:
        fetch-depth: 1
2 Replies
Highlighted
Solution
GitHub Staff
Message 2 of 3

Re: Env variables in uses

In order to enact policies like only using actions defined in the org or repo we can't allow actions to dynamically change at runtime.  So using any sort of dynamic value in uses is not something we will be able to support.

Highlighted
Copilot Lvl 3
Message 3 of 3

Re: Env variables in uses

This makes it more work to update multiple jobs to a newer version of an action or even different workflows since you could in theory just have the maintainers put the versions in a github secret and call it on all their workflows and update everything at once though i think its still better to just do it as a global env variable in the script so it is easier to see and modify in pull requests. If you do not thing this is something that will ever be support then i guess we can go ahead and mark this as solved then.