Giter Club home page Giter Club logo

create-opsgenie-alert-action's Introduction

Create OpsGenie alert action

Tests Compile

This GitHub Action allows you to create alerts in OpsGenie as part of your GitHub Actions workflows.

Usage

- name: Create OpsGenie Alert
  uses: rockem/create-opsgenie-alert-action@v1
  with:
    api_key: ${{ secrets.OPSGENIE_API_KEY }}
    message: >
      Activity exceeded timeout: exceeded 60 seconds
    alias: "workflow-failure"
    source: "GitHub Actions"

Inputs

  • `api_key` (Required): Your OpsGenie API key. It is recommended to store this as a secret in your GitHub repository.
  • `message` (Required): The short alert message.
  • `description`: A longer description of the alert.
  • `alias`: A unique identifier for the alert. Can be used for alert de-duplication.
  • `source`: The source of the alert. Defaults to IP address of incoming request.
  • `tags`: Tags of the alert, separated by commas.
  • `priority`: Priority level of the alert. Possible values are P1, P2, P3, P4 and P5. Default value is P3.
  • `using_eu_url`: Set the action to use OpsGenie europe endpoint 'https://api.eu.opsgenie.com'. Defaults to false
  • `responders`: List of comma seperated targets that the alert will be routed to. (each target should be in the format: <id type>:<id>:<responder type>)

Outputs

  • `request_id`: Request id for the create alert request.

Resources

License

This project is licensed under the MIT License. See the LICENSE file for details.


Feel free to contribute by opening issues or pull requests. If you have any questions or need assistance, please don't hesitate to reach out.

Happy coding!

create-opsgenie-alert-action's People

Contributors

debora38 avatar dependabot[bot] avatar rockem avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

create-opsgenie-alert-action's Issues

Redundant "ERROR" should be removed

Currently when there's some error we will see a line with the word error appears twice:
Error: ERROR: Could not authenticate

We should delete the redundant ERROR from there

Add support for responders parameter

As suggested by @muhammedsaidkaya on [#28], this is my solution for adding this optional parameter
Each responder is composed of identifier and type sent to OpsGenie as

{
  "identifier-type":"identifier-value",
  "type":"responder-type"
}

So, in order to simplify it for using in an action we'll do:

responders: identifier-type:identifier-value:responder-type, identifier-type:identifier-value:responder-type, ...

For example:

responders: id:4513b7ea-3b91-438f-b7e4-e3e54af9147c:team, name:NOC:team

Allow to set the host for OpsGenie if needed

Taken from OpsGenie docs:
Those using the European Service Region should set the EU endpooint in the configuration along with the API key.

opsgenie.configure({
    'api_key': 'your_api_key',
    'host': 'https://api.eu.opsgenie.com',
});

Default priority "P3" is not set

Thanks for creating this action.

I seems that "priority" is a mandatory field. But I guess the default P3 is not sent to OpsGenie API (see screenshot).

SCR-20240503-kqpv

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.