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
0
Merge Requests
0
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
iv
gitlab-ce
Commits
0550f2a5
Commit
0550f2a5
authored
Jun 23, 2016
by
Simon Welsh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for "skip ci" too
parent
2fc91c48
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
5 deletions
+36
-5
CHANGELOG
CHANGELOG
+1
-1
app/models/ci/pipeline.rb
app/models/ci/pipeline.rb
+1
-1
doc/ci/yaml/README.md
doc/ci/yaml/README.md
+2
-2
spec/services/create_commit_builds_service_spec.rb
spec/services/create_commit_builds_service_spec.rb
+32
-1
No files found.
CHANGELOG
View file @
0550f2a5
...
...
@@ -11,7 +11,7 @@ v 8.10.0 (unreleased)
- Fix changing issue state columns in milestone view
- Fix user creation with stronger minimum password requirements !4054 (nathan-pmt)
- Add API endpoint for a group issues !4520 (mahcsig)
- Allow [ci skip] to be in any case. !4785 (simon_w)
- Allow [ci skip] to be in any case
and allow [skip ci]
. !4785 (simon_w)
v 8.9.1
- Fix merge requests project settings help link anchor
...
...
app/models/ci/pipeline.rb
View file @
0550f2a5
...
...
@@ -163,7 +163,7 @@ module Ci
end
def
skip_ci?
git_commit_message
=~
/
(\[ci skip\])
/i
if
git_commit_message
git_commit_message
=~
/
\[(ci skip|skip ci)\]
/i
if
git_commit_message
end
def
environments
...
...
doc/ci/yaml/README.md
View file @
0550f2a5
...
...
@@ -1034,8 +1034,8 @@ You can find the link under `/ci/lint` of your gitlab instance.
## Skipping builds
If your commit message contains
`[ci skip]`
, using any capitalization, the
commit will be created but the builds will be skipped.
If your commit message contains
`[ci skip]`
or
`[skip ci]`
, using any
c
apitalization, the c
ommit will be created but the builds will be skipped.
## Examples
...
...
spec/services/create_commit_builds_service_spec.rb
View file @
0550f2a5
...
...
@@ -83,7 +83,9 @@ describe CreateCommitBuildsService, services: true do
context
'when commit contains a [ci skip] directive'
do
let
(
:message
)
{
"some message[ci skip]"
}
let
(
:messageFlip
)
{
"some message[skip ci]"
}
let
(
:capMessage
)
{
"some message[CI SKIP]"
}
let
(
:capMessageFlip
)
{
"some message[SKIP CI]"
}
before
do
allow_any_instance_of
(
Ci
::
Pipeline
).
to
receive
(
:git_commit_message
)
{
message
}
...
...
@@ -97,6 +99,21 @@ describe CreateCommitBuildsService, services: true do
after:
'31das312'
,
commits:
commits
)
expect
(
pipeline
).
to
be_persisted
expect
(
pipeline
.
builds
.
any?
).
to
be
false
expect
(
pipeline
.
status
).
to
eq
(
"skipped"
)
end
it
"skips builds creation if there is [skip ci] tag in commit message"
do
commits
=
[{
message:
messageFlip
}]
pipeline
=
service
.
execute
(
project
,
user
,
ref:
'refs/tags/0_1'
,
before:
'00000000'
,
after:
'31das312'
,
commits:
commits
)
expect
(
pipeline
).
to
be_persisted
expect
(
pipeline
.
builds
.
any?
).
to
be
false
expect
(
pipeline
.
status
).
to
eq
(
"skipped"
)
...
...
@@ -116,7 +133,21 @@ describe CreateCommitBuildsService, services: true do
expect
(
pipeline
.
status
).
to
eq
(
"skipped"
)
end
it
"does not skips builds creation if there is no [ci skip] tag in commit message"
do
it
"skips builds creation if there is [SKIP CI] tag in commit message"
do
commits
=
[{
message:
capMessageFlip
}]
pipeline
=
service
.
execute
(
project
,
user
,
ref:
'refs/tags/0_1'
,
before:
'00000000'
,
after:
'31das312'
,
commits:
commits
)
expect
(
pipeline
).
to
be_persisted
expect
(
pipeline
.
builds
.
any?
).
to
be
false
expect
(
pipeline
.
status
).
to
eq
(
"skipped"
)
end
it
"does not skips builds creation if there is no [ci skip] or [skip ci] tag in commit message"
do
allow_any_instance_of
(
Ci
::
Pipeline
).
to
receive
(
:git_commit_message
)
{
"some message"
}
commits
=
[{
message:
"some message"
}]
...
...
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