Why checkout action requires nodejs instead of using git?

We have a ruby app that runs on AWS lambda, so we run our specs on lambci/lambda:ruby2.5 to run a similar environment as our production. We try to have a workflow that has similar to this:

jobs:
  build:
    name: Build
    container: lambci/lambda:ruby2.5


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

      - uses: actions/cache@v1
        with:
          path: vendor/bundle
          key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
          restore-keys: |
            ${{ runner.os }}-gem-

      - name: Bundle install
        run: |
          bundle config path vendor/bundle
          bundle install --jobs 4 --retry 3

      - name: Run Specs
        run: bundle exec rspec

It’s failed in actions/checkout@v2-beta because it requires nodejs to be able to run the step which defeats the purpose to run in docker container environment. We don’t want to install nodejs because we need it just for the checkout step.

Shouldn’t it make more sense to the actions/checkout@v2-beta depends on git only instead of nodejs? Or the host machine can do the checkout and makes it available via the mounting. Similar behavior to CircleCI.

Github supports two type actions: JavaScript action and docker action.  ‘actions/checkout’ is a JavaScript action, it cannot only depend on ‘git’.

If a container is specified in the job, all steps will run in container instead of hosted environment VM. If the container doesn’t support javascript, it won’t be able to run the action.

The workaround is to update the image with dependences or to not use container and define the image to use for every single command. Please refer to similar ticket for more details.