Feature request: Shell script as type of action

In short, the ability to write actions using shell script as well as todays node and docker.

Why? The containers that runs the actions has a lot installed that could very well be used in small shell scripted actions. That way the actions would be fast as they would need no download time.

Also I think this would be easier, or a good alternative, to work with than the node type. I find the commiting of the node_modules a bit cumbersome and makes the repos bloated.

18 Likes

Hi @judoole,

Thanks for this feedback! We’re always working to improve GitHub and the GitHub Community Forum, and we consider every suggestion we receive. I’ve logged your feature request in our internal feature request list. Though I can’t guarantee anything or share a timeline for this, I can tell you that it’s been shared with the appropriate teams for consideration.

Cheers!

1 Like

@judoole wrote:
I find the commiting of the node_modules a bit cumbersome and makes the repos bloated.

You can use a packager for this. E.g.: https://github.com/1138-4EB/issue-runner/blob/master/webpack.config.js

1 Like

Likewise, lots of hoops to jump through just to run some simple cleanup scripts.

I wrote my first action which boils down to shelling out from node to a bash script.  Lots of hoops to jump through, and even more if I wanted to use the core modules (setting up a build step)!  

https://github.com/bcomnes/cleanup-xvfb if anyone is curious.  Overall though, I’m loving actions.  It seems as if shelling out from node seems to work, a script entrypoint could easily be exposed in the using filed:


runs:

  using: sh

  main: some-script.sh

1 Like

Very much agree with this. I would also like to see other action runners like Python, for example. There doesn’t even need to be a toolkit for these other languages. Someone would probably create one using the javascript actions/toolkit as a reference implementation.

I would just like to be able to say this in action.yml:

runs:
  using: 'python'
  main: 'main.py'

Also, one of the issues right now is that container actions only work on linux VMs. The only option for a multi-platform action is javascript.

1 Like

I was also wondering the same thing.

The ability to build simple shell based actions would be great, and the ability to build actions in Ruby would be awesome.

1 Like

If anyone is interested, I have created an easy workaround until GitHub Actions provide support for simple shell actions.

The idea is this:

  1. Have a small “run-remote” script in the repo (for example, in the .github folder)

  2. This script accepts two arguments: GitHub repo and path to script in that repo

  3. You can then simply run it in any step, and execute remote, github-hosted shell scripts

This is the .github/remote-run script (should have the executable bit on):

#!/usr/bin/env bash
repo=$1
script=$2
shift 2
url="https://raw.githubusercontent.com/$repo/master/$script"
curl -s $url | bash -s $*

Here is a sample step:

steps:
- name: Checkout code
  uses: actions/checkout@v2

- name: Run some remote script
  run: .github/remote-run dannyben/shell-action-example say-hello Thor

Here is the proof of concept and more details:

https://github.com/DannyBen/shell-action-example

1 Like

Guess this is now solved with https://docs.github.com/en/actions/creating-actions/creating-a-composite-run-steps-action