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

Ability to use host / shell runtime in actions #81

Open
davidferlay opened this issue Feb 14, 2025 · 1 comment
Open

Ability to use host / shell runtime in actions #81

davidferlay opened this issue Feb 14, 2025 · 1 comment

Comments

@davidferlay
Copy link
Contributor

Current

  • Action commands can only be run in container defined in action.yalm

Expected

  • Plugin commands should be able to be executed directly on host, using a kind of shell, as plugin actions do
  • This will allow actions commands to embed and run pre-confirugured actions for instance
@lexbritvin
Copy link
Collaborator

lexbritvin commented Mar 7, 2025

WIP

  1. Proper signal propagation to stop, kill, pause the actions, it's quite stable now. But ctrl+z may break execution, minor bug for me
  2. Env variables substitution. Example
    script: |
      # Uses host environment variable during action compilation
      echo "${MY_HOST_ENV_VAR}" 
      # Result: echo "my host var"
    
      # Escape replacement with double $$, uses variable from script runtime
      echo "$${MY_LOCAL_ENV_VAR}" 
      # Result: echo "${MY_LOCAL_ENV_VAR}"
    
      # Use \$(...) for escaping inside an argument like in normal bash
      # Use \$$i to escape inside an argument and not replace $i with a host variable.
      bash -c "for i in \$(seq 60); do echo \$$i; sleep 1; done"
      # Result: bash -c "for i in \$(seq 60); do echo \$i; sleep 1; done"
    
    I tried to rework escape to be more user friendly, but it became overcomplicated. So I will leave it as is with $$, need to document it.
  3. I played with current_bin variable to run sub actions. We may pass sensitive data like keyring passphrase to sub execution. As well as some other global flags like -vvvv. I investigated the secure ways to pass that. It may be a critical part to implement first to handle such cases easily without actions from user.

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