Skip to content

Examples

These examples use repository-specific CI workflows:

  • python-example: janitor-sh/action@v1 with tool: "ruff"
  • typescript-example: janitor-sh/action@v1 with tool: "biome"
  • rust-example: janitor-sh/action@v1 with tool: "clippy"
  • markdown-example: janitor-sh/action@v1 with tool: "rumdl"
  • go-example: go fmt ./... with conditional commit and push

Shared GitHub workflow pattern (janitor action repos)

Section titled “Shared GitHub workflow pattern (janitor action repos)”
name: Janitor
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
janitor:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref_name }}
- name: Run Janitor
uses: janitor-sh/action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
tool: "ruff"
- name: Push Janitor commit
run: git push