GithubHelp home page GithubHelp logo

akwak-metronom / notify-microsoft-teams Goto Github PK

View Code? Open in Web Editor NEW

This project forked from skitionek/notify-microsoft-teams

0.0 0.0 0.0 20.85 MB

Github action to send comprehensive raport to Microsoft Teams

JavaScript 100.00%

notify-microsoft-teams's Introduction

Notify Microsoft Teams

CI GitHub

Teams notify action inspired by git:homoluctus/slatify (for Slack).

This is Microsoft Teams Notification for GitHub Actions.
Generated from actions/javascript-template.

ToC

Feature

  • Notify the result of GitHub Actions
  • Support all job status (reference: job-context)
  • Logs relevant jobs ans steps along with their output in case of failure
  • Provides flexible interface to overwrite any part of the massage
  • Allows sending raw json-formatted messages directly from action definition

Usage

First of all, you need to set GitHub secrets for MSTEAMS_WEBHOOK that is Incoming Webhook URL.

You can customize the following parameters:

with parameter required/optional default description
webhook_url optional $MSTEAMS_WEBHOOK Microsoft Teams Incoming Webhooks URL
Please specify this key or MSTEAMS_WEBHOOK environment variable
job optional {}} JSON parsed job context
steps optional {} JSON parsed steps context
needs optional {} JSON parsed needs context
dry_run optional False Do not actually send the message
raw optional '' JSON object to send to Microsoft Teams
overwrite optional '' JSON like object to overwrite default message (executed with eval)

Please refer action.yml for more details.

Examples

name: Check notification

on:
  push: {}
  release: {}

jobs:
  success:
    name: One with everything
    runs-on: ubuntu-18.04
    steps:
      - uses: actions/checkout@master
      - name: Microsoft Teams Notification
        uses: skitionek/notify-microsoft-teams@master
        if: always()
        with:
          webhook_url: ${{ secrets.MSTEAMS_WEBHOOK }}
          needs: ${{ toJson(needs) }}
          job: ${{ toJson(job) }}
          steps: ${{ toJson(steps) }}
          dry_run: True


  without_optional_params:
    name: One with little info
    runs-on: ubuntu-18.04
    steps:
      - uses: actions/checkout@master
      - name: Microsoft Teams Notification
        uses: skitionek/notify-microsoft-teams@master
        if: always()
        with:
          webhook_url: ${{ secrets.MSTEAMS_WEBHOOK }}

  with_overwrite:
    name: One with overwrite
    runs-on: ubuntu-18.04
    steps:
      - uses: actions/checkout@master
      - name: Microsoft Teams Notification
        uses: skitionek/notify-microsoft-teams@master
        if: always()
        with:
          webhook_url: ${{ secrets.MSTEAMS_WEBHOOK }}
          overwrite: "{title: `Overwrote title in ${workflow_link}`}"

  with_raw:
    name: One with raw data
    runs-on: ubuntu-18.04
    steps:
      - uses: actions/checkout@master
      - name: Microsoft Teams Notification
        uses: skitionek/notify-microsoft-teams@master
        if: always()
        with:
          webhook_url: ${{ secrets.MSTEAMS_WEBHOOK }}
          raw: >-
            {
              "@type": "MessageCard",
              "@context": "http://schema.org/extensions",
              "title": "No ${variables} avaliable in here"
            }

  if_failure:
    name: Only if failure
    runs-on: ubuntu-18.04
    steps:
      - uses: actions/checkout@master
      - name: Microsoft Teams Notification
        uses: skitionek/notify-microsoft-teams@master
        if: failure()
        with:
          webhook_url: ${{ secrets.MSTEAMS_WEBHOOK }}

Microsoft Teams UI

Notification Preview 1 Notification Preview 2 Notification Preview 3 Notification Preview 4 Notification Preview 5 Notification Preview 6

Contribution

You are welcome to contribute in any form. I would gladly improve this package.

LICENSE

The MIT License (MIT)

notify-microsoft-teams's People

Contributors

bryanmacfarlane avatar dependabot[bot] avatar fregante avatar homoluctus avatar jasonetco avatar johanmeiring avatar semantic-release-bot avatar skitionek avatar wesleytodd avatar

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.