You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement support for skip CI commands in commit messages to allow
users to skip PipelineRun execution. Supports [skip ci], [ci skip],
[skip tkn], and [tkn skip] commands.
When a skip command is detected in the commit message, PipelineRun
execution is skipped. However, GitOps commands (/test, /retest, etc.)
will still trigger PipelineRuns regardless of the skip command,
allowing users to manually trigger CI when needed.
Jira: https://issues.redhat.com/browse/SRVKP-8933
Signed-off-by: Akshay Pant <akshay.akshaypant@gmail.com>
Copy file name to clipboardExpand all lines: README.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,6 +65,7 @@ Before getting started with Pipelines-as-Code, ensure you have:
65
65
-**Multi-provider support**: Works with GitHub (via GitHub App & Webhook), GitLab, Gitea, Bitbucket Data Center & Cloud via webhooks.
66
66
-**Annotation-driven workflows**: Target specific events, branches, or CEL expressions and gate untrusted PRs with `/ok-to-test` and `OWNERS`; see [Running the PipelineRun](https://pipelinesascode.com/docs/guide/running/).
67
67
-**ChatOps style control**: `/test`, `/retest`, `/cancel`, and branch or tag selectors let you rerun or stop PipelineRuns from PR comments or commit messages; see [GitOps Commands](https://pipelinesascode.com/docs/guide/gitops_commands/).
68
+
-**Skip CI support**: Use `[skip ci]`, `[ci skip]`, `[skip tkn]`, or `[tkn skip]` in commit messages to skip automatic PipelineRun execution for documentation updates or minor changes; GitOps commands can still override and trigger runs manually; see [Skip CI Commands](https://pipelinesascode.com/docs/guide/gitops_commands/#skip-ci-commands).
68
69
-**Feedback**: GitHub Checks capture per-task timing, log snippets, and optional error annotations while redacting secrets; see [PipelineRun status](https://pipelinesascode.com/docs/guide/statuses/).
69
70
-**Inline resolution**: The resolver bundles `.tekton/` resources, inlines remote tasks from Artifact Hub or Tekton Hub, and validates YAML before cluster submission; see [Resolver](https://pipelinesascode.com/docs/guide/resolver/).
70
71
-**CLI**: `tkn pac` bootstraps installs, manages Repository CRDs, inspects logs, and resolves runs locally; see the [CLI guide](https://pipelinesascode.com/docs/guide/cli/).
Copy file name to clipboardExpand all lines: docs/content/docs/guide/gitops_commands.md
+83Lines changed: 83 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,89 @@ Pipelines-as-Code supports the concept of `GitOps commands`, which allow users t
9
9
10
10
The advantage of using a `GitOps command` is that it provides a journal of all the executions of your pipeline directly on your Pull Request, near your code.
11
11
12
+
## Skip CI Commands
13
+
14
+
Pipelines-as-Code supports skip commands in commit messages that allow you to skip PipelineRun execution for specific commits. This is useful when making documentation changes, minor fixes, or work-in-progress commits where running the full CI pipeline is unnecessary.
15
+
16
+
### Supported Skip Commands
17
+
18
+
You can include any of the following commands anywhere in your commit message to skip PipelineRun execution:
19
+
20
+
-`[skip ci]` - Skip continuous integration
21
+
-`[ci skip]` - Alternative format for skipping CI
22
+
-`[skip tkn]` - Skip Tekton PipelineRuns
23
+
-`[tkn skip]` - Alternative format for skipping Tekton
24
+
25
+
**Note:** Skip commands are **case-sensitive** and must be in lowercase with brackets.
26
+
27
+
### Example Usage
28
+
29
+
```text
30
+
docs: update README with installation instructions [skip ci]
31
+
```
32
+
33
+
or
34
+
35
+
```text
36
+
WIP: refactor authentication module
37
+
38
+
This is still in progress and not ready for testing yet.
39
+
40
+
[ci skip]
41
+
```
42
+
43
+
### How Skip Commands Work
44
+
45
+
When a commit message contains a skip command:
46
+
47
+
1.**Pull Requests**: No PipelineRuns will be created when the PR is opened or updated with that commit
48
+
2.**Push Events**: No PipelineRuns will be created when pushing to a branch with that commit message
49
+
50
+
### GitOps Commands Override Skip CI
51
+
52
+
**Important:** Skip CI commands can be overridden by using GitOps commands. Even if a commit contains a skip command like `[skip ci]`, you can still manually trigger PipelineRuns using:
53
+
54
+
-`/test` - Trigger all matching PipelineRuns
55
+
-`/test <pipelinerun-name>` - Trigger a specific PipelineRun
56
+
-`/retest` - Retrigger failed PipelineRuns
57
+
-`/retest <pipelinerun-name>` - Retrigger a specific PipelineRun
58
+
-`/ok-to-test` - Allow running CI for external contributors
59
+
60
+
This allows you to skip automatic CI execution while still maintaining the ability to manually trigger builds when needed.
# Later, you can manually trigger CI by commenting on the PR:
71
+
# /test
72
+
# This will create PipelineRuns despite the [skip ci] command
73
+
```
74
+
75
+
### When to Use Skip Commands
76
+
77
+
Skip commands are useful for:
78
+
79
+
- Documentation-only changes
80
+
- README updates
81
+
- Comment or formatting changes
82
+
- Work-in-progress commits
83
+
- Minor typo fixes
84
+
- Configuration file updates that don't affect code
85
+
86
+
### When NOT to Use Skip Commands
87
+
88
+
Avoid using skip commands for:
89
+
90
+
- Code changes that affect functionality
91
+
- Changes to CI/CD pipeline definitions
92
+
- Dependency updates
93
+
- Any changes that should be tested before merging
94
+
12
95
## GitOps Commands on Pull Requests
13
96
14
97
For example, when you are on a Pull Request, you may want to restart failed PipelineRuns. To do so, you can add a comment on your Pull Request starting with `/retest`, and all **failed** PipelineRuns attached to that Pull Request will be restarted. If all previous PipelineRuns for the same commit were successful, no new PipelineRuns will be created to avoid unnecessary duplication.
0 commit comments