Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
box

GitHub Action

Setup Shell Wrapper

v1.0.4

Setup Shell Wrapper

box

Setup Shell Wrapper

Set up a shell wrapper script for setting the actions shell from the environment

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Setup Shell Wrapper

uses: SanderVocke/[email protected]

Learn more about this action in SanderVocke/setup-shell-wrapper

Choose a version

GitHub Action: Setup Shell Wrapper

The shell: directive in GitHub Actions does not support variables.

This action works around that by creating a shell wrapper which forwards execution to a shell set in the GitHub env variables.

Minimal example

runs-on: ubuntu-latest
steps:
    - uses: sandervocke/setup-shell-wrapper@v1
    - name: run command in bash
      shell: sh wrap-shell.sh {0}
      env:
        WRAP_SHELL: bash
      run: echo $0   # output: "bash"
    - name: run command in sh
      shell: sh wrap-shell.sh {0}
      env:
        WRAP_SHELL: sh
      run: echo $0   # output: "sh"