Skip to content

GitHub action to run promtool commands against Prometheus rules

License

Notifications You must be signed in to change notification settings

beatlabs/promtool-github-action

Repository files navigation

Linting

Promtool GitHub Action

Introduction

This simple GitHub Action allows to run various promtool commands on Prometheus rules files.

Example usage

name: Check Prometheus rules
on:
  pull_request:
    paths:
    - 'monitoring/prometheus/*.y*ml'

jobs:
  on-pull-request:
    name: On Pull Request
    runs-on: ubuntu-latest

    steps:
    - name: Checkout Repo
      uses: actions/checkout@v2

    - name: Check Prometheus rules
      uses: beatlabs/[email protected]
      with:
        cmd: 'check'
        files: 'monitoring/prometheus/*.y*ml'

    - name: Test Prometheus rules
      uses: beatlabs/[email protected]
      with:
        cmd: 'test'
        files: 'monitoring/prometheus/test*.y*ml'