Skip to content
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

How to pass GitHub workflow variables to CustomPiOS scripts #132

Open
cooked opened this issue Jun 28, 2021 · 3 comments
Open

How to pass GitHub workflow variables to CustomPiOS scripts #132

cooked opened this issue Jun 28, 2021 · 3 comments

Comments

@cooked
Copy link

cooked commented Jun 28, 2021

Hi,
as per the title I'd like define a variable in the GitHub worflow (and changing with something like strategy.matrix) and pass it down to the CustomPiOS scripts. While I can define the variable no problem, it seems I'm not able to read it properly from one bash script that is part of the filesystem I'm building.
Is it possible? If so, how?

Thanks in advance.

@guysoft
Copy link
Owner

guysoft commented Jun 28, 2021

In what phase are you trying to read it?

  1. Make sure to export it.
  2. Note that modules only export values starting with their name, eg the base module variables start with ${BASE_...}.
    Behavior coded here (related to how compgen works):
    https://github.com/guysoft/CustomPiOS/blob/devel/src/config#L105

@cooked
Copy link
Author

cooked commented Jun 30, 2021

@guysoft

  1. I'm setting up the workflow as follow:

image

image

then in the config file I'd like to use that variable to select only a subset of the modules available under src/modules

image

  1. I believe I'm not in that scenario since the variable is used before entering the modules, am I wrong?

@guysoft
Copy link
Owner

guysoft commented Jun 30, 2021

I think the best way is to add what you want to config.local. You can see how it can be used in this part of a github action:
https://github.com/guysoft/OctoPi/blob/devel/.github/workflows/build.yml#L41

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

No branches or pull requests

2 participants