-
In my action.yml I defined an input:
And in my workflow I passed the test_var:
So there should be an environment variable that’s created when the workflow runs, right? But when I run this short python script:
It prints:
Do I have to pass the env variable to my python script through the Dockerfile? Right now my Dockerfile looks like this:
Any help is appreciated. Here’s the link to the repo |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
Hi @paramt, Thank you for being here and apologies for the delay in response, I’m wondering if you are still having this issue? I think it might be a syntax problem on the variable name. |
Beta Was this translation helpful? Give feedback.
-
Yup, got the same problem in a different manifestation. I followed the manual https://help.github.com/en/github/automating-your-workflow-with-github-actions/creating-a-docker-container-action but altered a few details to get it working for my purpose.
Here’s the
Here’s the example workflow to test the whole thing:
Here’s my output:
You can see it’s using the default value defined in the actions metadata. Even if i try to use the variable as And here’s the thing: If i don’t default the value it doesn’t fail. There’s just an empty output like this:
Maybe there’s something wrong in my syntax. |
Beta Was this translation helpful? Give feedback.
-
Ok, Solved it myself. It was a Problem with cribbing the whole manual and adapting it wrongly. The line with
does the same as the one below but with no parameters given. So it defaults them. Still there’s the issue with undefaulted required parameters. I would expect Github to complain about this at execution time. @paramt I think in your case it’s quite simple to solve. You missed to hand your inputs over into your Docker Container.
hth |
Beta Was this translation helpful? Give feedback.
-
Yep, the problem was that the environment variable needed the ‘INPUT_’ prefix… So instead of looking for the TEST_VAR environment variable, I tried INPUT_TEST_VAR and it worked. |
Beta Was this translation helpful? Give feedback.
Yep, the problem was that the environment variable needed the ‘INPUT_’ prefix…
So instead of looking for the TEST_VAR environment variable, I tried INPUT_TEST_VAR and it worked.