6

I'd like to create a simple "hello, world" Gitlab CI script. I already got the Docker runner working and I'm experimenting with something like this:

image: debian:sid

test:first:
  script:
  - true

Unfortunately, the build fails with the error: test:first job: script should be a string or an array of a strings

What am I doing wrong?

2 Answers 2

3

After a bit of experimenting, I found the root cause and reported it as a bug. Apparently "true" was evaluated as a boolean here. Adding path to true executable helped solve the problem.

Sign up to request clarification or add additional context in comments.

1 Comment

I have also seen this error when I just need to convert all my tabs to spaces, when it should have complained about indentation, but instead gave me this error.
0

Double-check your spacing on the list lines - specifically that each dash is followed by a space. It can be an easy thing to overlook, especially if the "list" is only a single item.

(Though admittedly, that was not the cause of error in your "Hello world" CI file)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.