-
Notifications
You must be signed in to change notification settings - Fork 994
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support context/matrix variables and Composite Actions inputs in steps of type 'uses' #1479
Comments
You could try my action as a workaround, which writes and calls an interpolated - uses: ChristopherHX/conditional@b4a9649204f81002ec9a4ef7d4bf7d6b2ab7fa55
with:
step: |
uses: docker://${{ inputs.image }}
with:
args: doc/make.sh
- uses: ChristopherHX/conditional@b4a9649204f81002ec9a4ef7d4bf7d6b2ab7fa55
with:
step: |
uses: actions/checkout@${{ matrix.version }}
- uses: ChristopherHX/conditional@b4a9649204f81002ec9a4ef7d4bf7d6b2ab7fa55
with:
step: |
uses: ${{ matrix.action }}@v2 |
This would be an amazing feature to have (as well as cascading working-directory support). I understand the reasoning for no variables, but it'd be great if you can allow For relative actions in an actions monorepo, I'm currently using a hack that exposes the action's parent directory. FundingOptions/actions@6f3e0e7 This amazingly works, but could very easily break if sparse checkouts are implemented for actions, so treat this as "very undocumented behaviour." @ChristopherHX, I love that workaround, and I wish I'd thought of it when I did my pre-processor (clean-actions) ages ago, it would have simplified so much 🤣 |
Hoping this feature arrives soon too 🤞🏼 |
Hi @umarcor, this seems like a possibly useful addition. However, suggestions for GitHub Actions functionality belong in the GitHub feedback forum, where the product managers and engineers will be able to review them. This repository is really only focused on the runner application, which is a very small component of GitHub Actions. If you could open this issue there, that would be very helpful for us! 😄 In the meantime, I'm closing this issue here. Thanks again! |
@ethomson maybe you can create a |
Describe the enhancement
It is currently not possible to use variables from the matrix (in a regular workflow), or inputs (in a Composite Action) to define the Actions to be used in steps of type
uses
. The workflow won't start because of a parser/syntax issue:the
uses' attribute must be a path, a Docker image, or owner/repo@ref`.Code Snippet
See https://github.com/hdl/containers/blob/GHA-MWEs/.github/workflows/MWE-1479.yml and https://github.com/hdl/containers/blob/GHA-MWEs/utils/mwe-input-var-in-uses/action.yml:
Additional information
The inability to use Composite Action inputs in steps of type
uses: docker://
is particularly uncomfortable, because it forces using the docker CLI explicitly. Therefore, environment variables and binds need to be manually and explicitly described. See, for instance, the following workaround to the Composite Action above: https://github.com/VUnit/vunit_action/blob/master/action.yml.Being able to use the context would be a suitable solution to using a local action without explicitly checking out the repository, as discussed in #646 (comment). Precisely,
uses: ${{ github.repository }}/.github/myaction@${{ github.ref_name }}
would be equivalent to:/cc @thboop, per #646 (comment)
/cc @aramfe
The text was updated successfully, but these errors were encountered: