Skip to content
Snippets Groups Projects

Expand the details about parallel matrix with large vars

Merged Marcel Amirault requested to merge docs-parallel-matrix-details into master
All threads resolved!
+ 23
0
@@ -107,6 +107,29 @@ job:
@@ -107,6 +107,29 @@ job:
- make build
- make build
```
```
 
#### Skip job if the branch is empty
 
 
Use [`rules:changes:compare_to`](../yaml/index.md#ruleschangescompare_to) to avoid
 
running a job when the branch is empty, which saves CI/CD resources. Compare the
 
branch to the default branch, and if there are no changes found, the job doesn't run.
 
For example, in a project with `main` as the default branch:
 
 
```yaml
 
job:
 
script:
 
- echo "This job only runs for branches that are not empty"
 
rules:
 
- if: $CI_COMMIT_BRANCH
 
changes:
 
compare_to: refs/heads/main
 
paths:
 
- '*'
 
```
 
 
The rule for this job compares all files and paths (`*`) in the current branch against
 
the default branch `main`. If there are any changes to the files in the branch,
 
the rule matches and the job runs.
 
### Complex rules
### Complex rules
You can use all `rules` keywords, like `if`, `changes`, and `exists`, in the same
You can use all `rules` keywords, like `if`, `changes`, and `exists`, in the same
Loading