Skip to content
Snippets Groups Projects
Unverified Commit e1082ea3 authored by Nathan Friend's avatar Nathan Friend
Browse files

Update all only: and except: to take arrays

This commit updates all instances in the documentation where we
reference only: or except: to ensure they show the setting accepting an
array (as opposed to a single value).

Only/except do not support single values (i.e. `only: merge_requests`
is invalid).
parent e720dcd0
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -228,5 +228,5 @@ our very powerful [`only/except` rules system](../yaml/README.md#onlyexcept-basi
 
```yaml
my_job:
only: branches
only: [branches]
```
Loading
Loading
@@ -30,7 +30,7 @@ Pipelines for merge requests have the following requirements and limitations:
 
## Configuring pipelines for merge requests
 
To configure pipelines for merge requests, add the `only: merge_requests` parameter to
To configure pipelines for merge requests, add the `only: [merge_requests]` parameter to
the jobs that you want to run only for merge requests.
 
Then, when developers create or update merge requests, a pipeline runs
Loading
Loading
@@ -68,7 +68,7 @@ After the merge request is updated with new commits:
- The pipeline fetches the latest code from the source branch and run tests against it.
 
In the above example, the pipeline contains only a `test` job.
Since the `build` and `deploy` jobs don't have the `only: merge_requests` parameter,
Since the `build` and `deploy` jobs don't have the `only: [merge_requests]` parameter,
they will not run in the merge request.
 
Pipelines tagged with the **detached** badge indicate that they were triggered
Loading
Loading
@@ -86,7 +86,7 @@ Read the [documentation on Merge Trains](pipelines_for_merged_results/merge_trai
 
## Excluding certain jobs
 
The behavior of the `only: merge_requests` parameter is such that _only_ jobs with
The behavior of the `only: [merge_requests]` parameter is such that _only_ jobs with
that parameter are run in the context of a merge request; no other jobs will be run.
 
However, you may want to reverse this behavior, having all of your jobs to run _except_
Loading
Loading
Loading
Loading
@@ -780,7 +780,7 @@ it is possible to define a job to be created based on files modified
in a merge request.
 
In order to deduce the correct base SHA of the source branch, we recommend combining
this keyword with `only: merge_requests`. This way, file differences are correctly
this keyword with `only: [merge_requests]`. This way, file differences are correctly
calculated from any further commits, thus all changes in the merge requests are properly
tested in pipelines.
 
Loading
Loading
@@ -802,7 +802,7 @@ either files in `service-one` directory or the `Dockerfile`, GitLab creates
and triggers the `docker build service one` job.
 
Note that if [pipelines for merge requests](../merge_request_pipelines/index.md) is
combined with `only: change`, but `only: merge_requests` is omitted, there could be
combined with `only: [change]`, but `only: [merge_requests]` is omitted, there could be
unwanted behavior.
 
For example:
Loading
Loading
Loading
Loading
@@ -699,7 +699,7 @@ nicely on different mobile devices.
## Code blocks
 
- Always wrap code added to a sentence in inline code blocks (`` ` ``).
E.g., `.gitlab-ci.yml`, `git add .`, `CODEOWNERS`, `only: master`.
E.g., `.gitlab-ci.yml`, `git add .`, `CODEOWNERS`, `only: [master]`.
File names, commands, entries, and anything that refers to code should be added to code blocks.
To make things easier for the user, always add a full code block for things that can be
useful to copy and paste, as they can easily do it with the button on code blocks.
Loading
Loading
Loading
Loading
@@ -69,7 +69,7 @@ For example, to that on merge requests there is always a passing job even though
 
```yaml
enable_merge:
only: merge_requests
only: [merge_requests]
script:
- echo true
```
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment