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

feat: set the shell for workflow command steps #5024

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

anryko
Copy link
Contributor

@anryko anryko commented Oct 22, 2024

what

Added an option to define the shell for the custom workflow steps with the command filed, like run, env, and multienv.

why

  • This change simplifies writing more elaborate shell logic.
  • The same functionality is achievable by running command: bash -c "my inline shell script", but dealing with double quote escaping within the shell script is quite cumbersome.
  • The default busybox shell is limited and having "native" access to bash will improve user experience.

tests

  • I run the unit tests.
  • I verified manually tested this functionality on a local setup.

references

@anryko anryko requested review from a team as code owners October 22, 2024 16:54
@anryko anryko requested review from chenrui333, nitrocode and X-Guardian and removed request for a team October 22, 2024 16:54
@github-actions github-actions bot added docs Documentation go Pull requests that update Go code labels Oct 22, 2024
@dosubot dosubot bot added the feature New functionality/enhancement label Oct 22, 2024
@X-Guardian
Copy link
Contributor

Hi @anryko, thanks for this. Any chance you can follow the same pattern as the pre/post workflow hooks to have the ability to specify the shell and shellargs. See https://www.runatlantis.io/docs/pre-workflow-hooks.html#reference.

I also see no reason to limit the shell to bash and sh.

@anryko
Copy link
Contributor Author

anryko commented Oct 23, 2024

@X-Guardian sure, I'll do that. I would suggest to make shellArgs to be a list. This would make sense because it's a list of arguments and will be consistent with extra_args property (like plan.extra_args []string).

@anryko anryko force-pushed the feat_1417_1 branch 2 times, most recently from 805b7ff to e365fca Compare October 30, 2024 20:55
@anryko
Copy link
Contributor Author

anryko commented Oct 30, 2024

@X-Guardian I added support for shellArgs and removed the limit for the shell option as it was suggested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation feature New functionality/enhancement go Pull requests that update Go code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow Specifying Custom Script Runner
2 participants