Giter Club home page Giter Club logo

maven-discord-integration's Introduction

Fancier Discord Webhook

This GitHub Action can produce fancy and more meaningful discord messages for your commits.
It includes Test results and coverage.

πŸ““ Requirements

This currently works only for Maven projects. For Test Results and Coverage Reports you will need to use one of the following Maven plugins:

  • maven-surefire
  • maven-failsafe
  • jacoco

πŸ“­ Inputs

id

Required This is the id of your Discord webhook, if you copy the webhook url, this will be the first part of it.

token

Required Now your Discord webhook token, it's the second part of the url.

πŸ–ΌοΈ Screenshots

The standard webhook from GitHub to Discord just dumps the commit messages right into your chat, this is fine but sometimes you just want some extra information. Did the commit introduce any new issues? Did it even compile successfully? That's what this Action is for.

πŸ•ΈοΈ Standard Webhook

old webhook

⭐ New and improved Webhook

tests passed tests skipped tests failed

πŸ“š Changes

  • Removed the obnoxious author name and image at the top (may be a toggle in the future)
  • The branch is now clearly visible "Slimefun4:master" -> "Slimefun4 (master)"
  • The repository is now referred to by its full name, including the repository owner
  • The embed now includes a timestamp (it is actually the timestamp of the commit, not just the current date of when the webhook was sent)
  • Commit messages have slightly shorter limits and the committer is now better distinguishable from the commit message "Reduced technical debt - TheBusyBiscuit" -> "Reduced technical debt (@TheBusyBiscuit)"
  • Includes test results, passes will be prepended with a green circle, skips with yellow and failures with red.
  • It will also list the exact tests which failed (max of 4, then it will crop them)
  • An estimated test coverage is provided if you use the jacoco maven plugin.
  • Dynamic embed color changes

🎨 Dynamic Coloring

The color of the embed changes depending on the compiler and test results. Here's a breakdown:

Color Description
red The build has failed.
orange The build was successful but some tests failed.
yellow The build was successful, no tests failed but some were skipped.
green The build was successful, no tests failed and none were skipped.

πŸ“œ Example setup

To set up this Action, create a new workflow file under .github/workflows/workflow_name.yml.

Important: Your project must have a pom.xml file, this Action only supports Maven at the moment.
To report Unit Tests and coverage, you will need maven-surefire / maven-failsafe and/or jacoco.

This workflow is rather simple, it checks out your repository, sets up Java and the webhook will then run mvn test and report the results to your discord webhook. You should configure the webhook id in advance.

name: Discord Webhook

on: [push]

jobs:
  report-status:

    runs-on: ubuntu-latest

    steps:
    - name: Checkout repository
      uses: actions/[email protected]
    - name: Set up Java JDK 11
      uses: actions/[email protected]
      with:
        distribution: 'adopt'
        java-version: '11'
        java-package: jdk
        architecture: x64
    - name: Run Discord Webhook
      uses: baked-libs/discord-webhook@main
      with:
        id: ${{ secrets.YOUR_DISCORD_WEBHOOK_ID }}
        token: ${{ secrets.YOUR_DISCORD_WEBHOOK_TOKEN }}

maven-discord-integration's People

Contributors

dependabot[bot] avatar imgbotapp avatar renovate-bot avatar thebusybiscuit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

maven-discord-integration's Issues

FAILURE in default

{ status: 'FAILURE', tests: [], coverage: 0, time: '0.000' }

Hello i've got no tests but the Action show the push in Failure.. the embed is red and no logs about that.

image

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

npm
package.json
  • @actions/core ^1.2.3
  • @actions/github ^5.0.0
  • discord.js ^12.0.0
  • child-process-promise ^2.2.1
  • xml-library 0.2.0

  • Check this box to trigger a request for Renovate to run again on this repository

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.