Skip to content
92 changes: 92 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,98 @@ Ideally, the new branch should be based on the latest `dev` branch.
1. Reviewer and contributor may have discussions back and forth until all comments addressed.
1. Wait for the pull request to be merged.

## Skipping CI

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add the new section to the Table of Contents.

## Skipping CI was added, but the TOC (Lines 1-16) was not updated with a link entry.

As per coding guidelines, "Remember that documentation must be updated with the latest information."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@CONTRIBUTING.md` at line 335, Add a Table of Contents entry linking to the
newly added "## Skipping CI" section: update the TOC block at the top (lines
1-16) to include a markdown link like "- [Skipping CI](`#skipping-ci`)" so the new
heading is discoverable; ensure the anchor matches the heading slug format used
throughout the document and maintain TOC ordering/formatting consistent with
existing entries.


MONAI's CI pipelines run automatically on every push and pull request.
These pipelines can be resource-intensive, especially the full premerge matrix
which spans multiple OSes, Python versions, and PyTorch versions.

To reduce unnecessary resource consumption and speed up iteration, you can
skip CI on commits that don't need automated validation — for example,
documentation-only changes, README updates, workflow YAML changes, or WIP
commits during development.

### Mechanism

GitHub Actions natively supports skipping `push` and `pull_request` workflows
when the commit message contains any of the following strings:

- `[skip ci]`
- `[ci skip]`
- `[no ci]`
- `[skip actions]`
- `[actions skip]`

These are case-insensitive. `[skip ci]` is the recommended convention for
this repository.

Alternatively, you can add a `skip-checks: true` trailer at the end of the
commit message, preceded by two blank lines:

```
commit message

skip-checks: true
```
Comment thread
coderabbitai[bot] marked this conversation as resolved.

### Usage

Add the keyword anywhere in the commit message when committing:

```bash
git commit -s -m 'update docs [skip ci]'
```

If the HEAD commit of a pull request contains the skip instruction,
the entire PR's pull_request-triggered workflows are skipped.

### Which workflows are affected

The skip instruction applies only to workflows using `on: push` or
`on: pull_request` events. In this repository, that includes:

- **premerge** (multi-OS lint, tests, packaging, docs build)
- **premerge-min** (minimal dependency matrix)
- **premerge-gpu** (GPU tests)
- **CodeQL analysis**
- **Docker build**
- **Release packaging**
- **Setup/install tests**

The following workflows use different event types (`issue_comment`,
`repository_dispatch`, `schedule`, `workflow_dispatch`) and are **not**
affected by `[skip ci]`:

- **Blossom-CI** (triggered by `/build` comment — maintainers only)
- **ChatOps** (triggered by `/black` or `/integration-test` comment)
- **Integration tests** (triggered by `/integration-test` comment)
- **Cron jobs** (scheduled, not per-commit)
- **Weekly preview** (scheduled, not per-commit)
- **Conda build** (scheduled, not per-commit)

### Important caveat

If a workflow is skipped via `[skip ci]`, its associated checks remain in
"Pending" state. If your pull request requires those checks to pass before
merging, you will need to push a new commit **without** the skip instruction
to trigger the CI pipelines.

### When to use

Use `[skip ci]` for commits that are safe to skip CI:

- Documentation-only changes (`docs/`, `README.md`, docstrings)
- Workflow configuration changes (`.github/`)
- Repository metadata (`.gitignore`, `CONTRIBUTING.md`, `LICENSE`)
- WIP or draft commits during local development

Do **not** use `[skip ci]` for commits that change:

- Source code in `monai/`
- Test files in `tests/`
- Dependencies (`requirements*.txt`, `setup.cfg`, `setup.py`)
- Anything that could affect correctness or compatibility

## The code reviewing process


Expand Down