!reference not working in multi line commands
<!--IssueSummary start-->
<details>
<summary>
Everyone can contribute. [Help move this issue forward](https://handbook.gitlab.com/handbook/marketing/developer-relations/contributor-success/community-contributors-workflows/#contributor-links) while earning points, leveling up and collecting rewards.
</summary>
- [Close this issue](https://contributors.gitlab.com/manage-issue?action=close&projectId=278964&issueIid=392332)
</details>
<!--IssueSummary end-->
## Summary
!reference tags are not evaluated in multi line commands.
It would be great to have that as a possibility since we use it to reuse code.
Especially in conditions or loops it is currently not directly possible to reuse code.
## Steps to reproduce
Have a !reference tag inside a multi line command
<details>
<summary> .gitlab-ci.yml </summary>
```yml
stages: # List of stages for jobs, and their order of execution
- build
build-job: # This job runs in the build stage, which runs first.
stage: build
script:
- echo "Compiling the code..."
- |
echo "This is a multi line command"
!reference [.reused-script, script]
- echo "Compile complete."
.reused-script:
script:
- echo "This is working"
```
</details>
## Actual behavior
The !reference tag ist not replaced by the referenced code.
## Expected behavior
The !reference tag ist replaced by the referenced code.
Output:
This is a multi line command
This is working
## Relevant logs and/or screenshots
<!--
Paste the job logs inside of the code blocks (```) below so it would be
easier to read.
-->
<details>
<summary> job log </summary>
```sh
Running with gitlab-runner 15.2.0 (7f093137)
on Local machine(Thore) e2Lk-y91
Resolving secrets
00:00
Preparing the "shell" executor
00:00
Using Shell executor...
Preparing environment
00:05
Running on DEAGM11951...
Getting source from Git repository
00:05
Fetching changes with git depth set to 20...
Initialized empty Git repository in C:/Program Files/gitlab-runner/builds/e2Lk-y91/0/staecth/gitlab-ci-test/.git/
Created fresh repository.
Checking out 6838ad89 as main...
git-lfs/3.2.0 (GitHub; windows amd64; go 1.18.2)
Skipping Git submodules setup
Executing "step_script" stage of the job script
00:00
$ echo "Compiling the code..."
Compiling the code...
$ echo "This is a multi line command" # collapsed multi-line command
This is a multi line command
!reference:
Line |
232 | !reference [.reused-script, script]
| ~~~~~~~~~~
| The term '!reference' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
Cleaning up project directory and file based variables
00:01
ERROR: Job failed: exit status 1
```
</details>
## Investigation log
- 2023-02-18: Created a pipeline using the example provided in the [steps to produce section](https://gitlab.com/gitlab-org/gitlab/-/issues/392332#steps-to-reproduce). The job will fail.
- 2023-02-18: Created a new pipeline, but instead moved the command to a separate line. The job completes successfully.
```
stages:
- build
build-job:
stage: build
script:
- echo "Compiling the code..."
- echo "!reference [.reused-script, script] command in separate line"
- !reference [.reused-script, script]
- echo "Compile complete."
.reused-script:
script:
- echo "This is working"
```
### screenshot

## Proposal
{placeholder for solution proposal}
issue