Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
13db02a5
Commit
13db02a5
authored
Mar 01, 2021
by
Marcel Amirault
Committed by
Suzanne Selhorn
Mar 01, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update details about colons in CI scripts
parent
1ca72d70
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
0 deletions
+31
-0
doc/ci/yaml/script.md
doc/ci/yaml/script.md
+31
-0
No files found.
doc/ci/yaml/script.md
View file @
13db02a5
...
...
@@ -145,3 +145,34 @@ job:
-
Write-Host $TXT_RED"This text is red,"$TXT_CLEAR" but this text isn't"$TXT_RED" however this text is red again."
-
Write-Host "This text is not colored"
```
## Troubleshooting
### `Syntax is incorrect` in scripts that use `:`
If you use a colon (
`:`
) in a script, GitLab might output:
-
`Syntax is incorrect`
-
`script config should be a string or a nested array of strings up to 10 levels deep`
For example, if you use
`"PRIVATE-TOKEN: ${PRIVATE_TOKEN}"`
as part of a cURL command:
```
yaml
pages-job
:
stage
:
deploy
script
:
-
curl --header 'PRIVATE-TOKEN
:
${PRIVATE_TOKEN}' "https://gitlab.example.com/api/v4/projects"
```
The YAML parser thinks the
`:`
defines a YAML keyword, and outputs the
`Syntax is incorrect`
error.
To use commands that contain a colon, you should wrap the whole command
in single quotes. You might need to change existing single quotes (
`'`
) into double quotes (
`"`
):
```
yaml
pages-job
:
stage
:
deploy
script
:
-
'
curl
--header
"PRIVATE-TOKEN:
${PRIVATE_TOKEN}"
"https://gitlab.example.com/api/v4/projects"'
```
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment