Skip to content

Add posix shell quoting implementation

Arran Walker requested to merge ajwalker/posix-escape into main

What does this MR do?

Adds posix shell quoting/escaping.

Why was this MR needed?

This allows scripts to be used with posix shells, and not just Bash.

What's the best way to test this MR?

This new functionality is mainly to be used with posix shells that were previously unsupported. It works best in combination with the changes made in !3014 (merged).

It's possible that the escaping doesn't work in every scenario we have, but this is behind a feature flag so should be relatively safe.

It should also work with Bash though, so simply testing a job with and without the feature flag should be an okay manual QA:

variables:
   FF_POSIXLY_CORRECT_ESCAPES: "true"

test:
  script:
    - echo "Hello World"

What are the relevant issue numbers?

Closes #28957 (closed)

Edited by Arran Walker

Merge request reports