Coder Social home page Coder Social logo

amtoolcm-github-actions's Introduction

AMToolCM GitHub Actions

AMTool GitHub Actions allow you to check Prometheus Alertmanager config within GitHub Actions.

The output of the actions can be viewed from the Actions tab in the main repository view. If the actions are executed on a pull request event, a comment may be posted on the pull request.

Success Criteria

An exit code of 0 is considered a successful execution.

Usage

amomtool GitHub Actions are a single GitHub Action that executes amtool check-config subcommand.

name: Check Prometheus Alertmanager Config

on:
  pull_request:
    paths:
    - 'alertmanager/config.yml'

jobs:
  on-pull-request:
    name: On Pull Request
    runs-on: ubuntu-latest
    steps:
    - name: Checkout Repo
      uses: actions/checkout@master

    - name: Check Prometheus Alertmanager Config
      uses: peimanja/amtoolcm-github-actions@main
      with:
        amtool_actions_config: 'alertmanager/config.yml'
        amtool_actions_version: '0.21.0'
        amtool_actions_comment: true
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Inputs

Inputs configure amtool GitHub Actions to perform different actions.

  • amtool_actions_config - (Required) Path to Alertmanager config file.
  • amtool_actions_version - (Optional) amtool version to install and execute (Alertmanager bundle version). The default is set to latest and the latest stable version will be pulled down automatically.
  • amtool_actions_comment - (Optional) Whether or not to comment on GitHub pull requests. Defaults to true.

Secrets

Secrets are similar to inputs except that they are encrypted and only used by GitHub Actions. It's a convenient way to keep sensitive data out of the GitHub Actions workflow YAML file.

  • GITHUB_TOKEN - (Optional) The GitHub API token used to post comments to pull requests. Not required if the amtool_actions_comment input is set to false.

amtoolcm-github-actions's People

Contributors

erikeverts avatar peimanja avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

amtoolcm-github-actions's Issues

Validation Error: unknown time zone. Add `tzdata` pkg to Dockerfile

When running this action against alertmanager configs that contain time_intervals, and the location is set, the validation will fail as the timezone is not known.

The alpine:3 docker image does not contain tzdata, so the Dockerfile should add this package alongside the others.

# Without tzdata package
> amtool check-config alertmanager.yaml
Checking 'alertmanager.yaml'  FAILED: unknown time zone America/New_York

amtool: error: failed to validate 1 file(s)

# Add tzdata package
> apk add tzdata
(1/1) Installing tzdata (2023c-r1)
OK: 46 MiB in 28 packages
> amtool check-config alertmanager.yaml
Checking 'alertmanager.yaml'  SUCCESS
Found:
 - global config
 - route
 - 1 inhibit rules
 - 71 receivers
 - 1 templates
  SUCCESS

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.