Usage of expressions and contexts in uses
clause
#27048
-
I’ve got a use case where I want to test my action in an example workflow. Something like this:
In my case I test a fork of a Github Repo. This means the root of my fork has another repository name than I do. This is currently not possible and ends with:
|
Beta Was this translation helpful? Give feedback.
Replies: 10 comments 7 replies
-
You can use path as argument for
|
Beta Was this translation helpful? Give feedback.
-
Thank you very much. This did the trick. Kudos to you 😃 |
Beta Was this translation helpful? Give feedback.
-
For a bit more color. Because we have the settings where a repo or org owner can specify if they want third party actions or not we need to be able to resolve the full list of referenced actions before we start the workflow. If we enabled expressions in the uses section that would not be possible until runtime and we would potentially get hours into a job before it failed due to this policy. |
Beta Was this translation helpful? Give feedback.
-
Thank you for this explanation |
Beta Was this translation helpful? Give feedback.
-
Do you have a working example for this? When I tried this it was not doing anything: https://github.com/eps1lon/actions-label-merge-conflict/blob/2f617ca50dfb880adbf628a61e3d4f427561a1df/.github/workflows/ci.yml#L24 |
Beta Was this translation helpful? Give feedback.
-
This works fine for me if you have an action.yml in your root directory
|
Beta Was this translation helpful? Give feedback.
-
@wipe2238 The link to the docs seems to be outdated. |
Beta Was this translation helpful? Give feedback.
-
You can work around this with nested composite actions; although the job step's Given a step like so: - uses: actions/setup-node@v3
with:
node-version: 18 If you want your - uses: jenseng/dynamic-uses@v1
with:
# now you can use expressions 🥳
uses: actions/setup-node@${{ inputs.version }}
# the `with` needs to be converted to a valid json string
with: '{ "node-version": 18 }' |
Beta Was this translation helpful? Give feedback.
You can use path as argument for
uses
, so this should do the trick