Skip to content

fix: env variable passed to the python container action#135

Open
los0220 wants to merge 2 commits intosidpalas:mainfrom
los0220:main
Open

fix: env variable passed to the python container action#135
los0220 wants to merge 2 commits intosidpalas:mainfrom
los0220:main

Conversation

@los0220
Copy link

@los0220 los0220 commented Feb 9, 2026

This is a fix for the issue I created #134

I added INPUT_WHO_TO_GREET to the 06-authoring-actions/container-actions/python-container-action/action.yaml, to be properly passed to the Python container as an environmental variable.

I also commented out the args and added comments explaining the usage of environmental variables and argument list in both action.yaml and entrypoint.py

@los0220
Copy link
Author

los0220 commented Feb 10, 2026

Maybe it would be a good idea to show both methods with two separate variables, but that would be different from what's in the YT video.

@sidpalas
Copy link
Owner

Hmm, based on the docs it should populate an env var but it might be

"INPUT_WHO-TO-GREET" (only spaces get replaced with underscores, not hyphens)

Mind testing that?

@los0220
Copy link
Author

los0220 commented Feb 11, 2026

@sidpalas
Yes, you are right, I didn't think of that solution.

I printed the env using printenv | grep INPUT, and the passed variable name is INPUT_WHO-TO-GREET.

I tested it in my forked repo:

@los0220
Copy link
Author

los0220 commented Feb 11, 2026

I changed the variable name to INPUT_WHO-TO-GREET in the python-container-action.

Now it works as expected: job in my repo

What about shell-container-action and shell-container-action-prebuilt? Both use the INPUT_WHO_TO_GREET passed using:

  env:
    INPUT_WHO_TO_GREET: ${{ inputs.who-to-greet }}

It's the same as in actions/container-action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants