Allow to choose shell in .gitlab-ci.yml

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

  • Close this issue

Problem to solve

Only the default shell can be used for your script.

Intended users

Developers.

Further details

Sometimes you want to use a more advanced shell for more advanced scripts, such as Fish or Plumbum.

Proposal

I can think of 2 options:

  1. Add a script_shell key (and possibly before_script_shell and after_script_shell).

  2. If a script starts with a shebang, use that:

    myjob:
      script:
        - echo normal script
        - |
          #!/usr/bin/python
          print("special script")

Permissions and Security

N/A

Documentation

It should be added to https://docs.gitlab.com/ce/ci/yaml/

Testing

Add a test using a separate shell.

What does success look like, and how can we measure that?

Success would be if the feature works... I guess 🤔.

Links / references

Edited Aug 13, 2025 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading