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

Add initialization step #33

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

luca-della-vedova
Copy link
Member

Certain downstream repos might need an initialization step to be ran before the workflow itself.
Reusable workflows cannot be executed as a step so adding a step in the downstream repo is not possible (I believe?), so I tried the approach of allowing command injection by specifying an input variable that is executed as a bash command. The step is ignored if no command is specified.

Example of usage in colcon/colcon-ros-cargo#22. colcon-ros-cargo needs to run cargo install cargo-ament-build before it can run its CI, so we inject it into the prerun-step variable and that allows us to setup the workflow correctly.

Note that I'm not sure there is a better way to add a setup step before running a reusable workflow, I saw threads suggesting using a local action but didn't have much luck with it, open to suggestions if there are better ways!

Signed-off-by: Luca Della Vedova <[email protected]>
Copy link

@jhdcs jhdcs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like if this works for now, we might as well add it in. No need for perfection to become the enemy of good enough.

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

Successfully merging this pull request may close these issues.

3 participants