Skip to content

About

Webhook based Discord bot that notifies Discord of failed builds.

Topics

Resources

Stars

0 stars

Watchers

4 watching

Forks

Repository files navigation

discord-bully

Webhook based Discord bot that notifies Bedrock OSS members on discord of failed builds or succeeded builds after a failed one.

Currently, the configuration is pretty much static, but full configuration is planned, so that others can use this action as well.

Example configuration

Add GitHub Action secrets WEBHOOK_ID and WEBHOOK_TOKEN from Discord webhook integrations. Add GitHub Action secret GIF_API_KEY with an API key from KLIPY (default) or GIPHY (set gifProvider: giphy). Tenor API was shut down and is no longer supported.

Add this step to GitHub Action:

      - name: Notify of failed build
        if: ${{ failure() }}
        uses: Bedrock-OSS/discord-bully@v2.0.1
        with:
          webhook: https://canary.discord.com/api/webhooks/${{ secrets.WEBHOOK_ID }}/${{ secrets.WEBHOOK_TOKEN }}
          gifApiKey: ${{ secrets.GIF_API_KEY }}
          failTitle: 'Wiki deployment failed!'
          failMessage: '%random% <:PE_PandaBonk:885395101877166110>'
          gifFailQuery: 'fail'
          failAuthor: 'You messed up'
          successTitle: 'Wiki deployment succeeded!'
          successMessage: '%random% <:PE_PandaInLove:885395799029194853>'
          gifSuccessQuery: 'success'
          successAuthor: 'You did it'
          failed: ${{ failure() }}

Messages support these placeholders:

  • %author% or {user} - commit author mention
  • %newline% - line break
  • %random% - random message from fail-messages.json or success-messages.json. You can use your own lists (JSON array of strings) with failMessagesFile and successMessagesFile.

An entry in the fail messages list can also be an object with a matching success message. When the build gets fixed, the success message will use it instead of a random one:

{
  "message": "{user}, you absolute **croissant**.",
  "success": "The build is fixed. {user} is officially **not a croissant** today. 🥐"
}

Add to index.js a map of GitHub usernames to Discord IDs like this:

const USER_MAP = {
  'stirante': '210798002808422400',
  'SirLich': '97792771619827712',
  'MedicalJewel105': '738693702297321544',
  'sermah': '305566858461970433',
  'SmokeyStack': '530361907283099650'
}

TODO

  • Move user map outside the code to allow easier configuration.
  • Move remaining message parts to the action config

About

Webhook based Discord bot that notifies Discord of failed builds.

Topics

Resources

Stars

0 stars

Watchers

4 watching

Forks

Releases

Packages

Used by

Contributors

Languages