When I invoke an action I wrote with an input, the input doesn't seem to be visible to the action #26063
-
I’m in the process of writing my own action, contained in this repo: https://github.com/enarx/nightly-features As part of the action’s definition, I expect some input (I’ve named it However, this doesn’t seem to be working for me. I’ve written a workflow that invokes this action here. It provides the input, as far as I can tell, correctly; however, when I run that workflow, the action I wrote doesn’t seem to be able to read from the expected environment variable. You can see that demonstrated in this workflow run: https://github.com/mbestavros/enarx/runs/1009733602?check_suite_focus=true I’ve dumped the environment variables into the log from the called action, and it doesn’t deem to have the expected Does anyone have any pointers as to how I’m going wrong? I’ve looked at other examples, and everything I’ve looked at suggests I’m doing things correctly. Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
For testing purposes, could you add this to your
|
Beta Was this translation helpful? Give feedback.
-
Simran-B:
@Simran-B Fascinating… How would one access |
Beta Was this translation helpful? Give feedback.
-
Hi @mbestavros, In action.yaml, you can use ‘set-env’ to add ${{ inputs.allowed_features }} to env context, then you can get it from the shell.
I forked your action repo and confirmed it works(comment some shell script), please check it for your reference. weide-zhou/nightly-features/blob/3d5ebb298f664b66a0c6a7e9264229397d0f264b/action.yml
This file has been truncated. show original Thanks |
Beta Was this translation helpful? Give feedback.
-
@Simran-B @weide-zhou Thanks so much to both of you for your help! It works like a charm now :slight_smile: It would be helpful if the Actions documentation was updated with this alternative. I had no idea of this approach from just reading; having this called out would be helpful for future Actions developers. |
Beta Was this translation helpful? Give feedback.
-
Glad to support 😉! @mbestavros According to the policy, you can raise a feedback ticket in below link to ask for doc update, github product manager will take a review and help to check, thanks. https://support.github.com/contact/feedback?contact[category]=actions |
Beta Was this translation helpful? Give feedback.
Hi @mbestavros,
In action.yaml, you can use ‘set-env’ to add ${{ inputs.allowed_features }} to env context, then you can get it from the shell.
I forked your action repo and confirmed it works(comment some shell script), please check it for your reference.
github.comweide-zhou/nightly-features/blob/3d5ebb298f664b66a0c6a7e9264229397d0f264b/action.yml