Skip to content

tgstation/discord-notify

This branch is 1 commit ahead of, 6 commits behind TiviPlus/discord-notify:main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

TiviPlusTiviPlus
TiviPlus
and
TiviPlus
Feb 27, 2025
55b326c · Feb 27, 2025

History

42 Commits
Nov 4, 2024
Feb 27, 2025
Feb 20, 2025
Feb 27, 2025
Sep 25, 2022
Sep 25, 2022
Sep 25, 2022
Sep 25, 2022
Sep 25, 2022
Sep 25, 2022
Sep 25, 2022
Sep 25, 2022
Feb 27, 2025
Feb 27, 2025
Sep 25, 2022
Nov 4, 2024
Jul 3, 2024
Sep 25, 2022

Repository files navigation

Discord Notify Action

This action sends a notification to Discord.

Usage

Input Required Default Description
webhook_url Webhook URL(s) from Discord. comma seperated
title Title for card. If set to "GET_ACTION" will replace with the action taken and by whom (e.g PR #123 closed by Joe)
message Content of cardIf set to "GET_ACTION" will replace with the action taken and by whom (e.g PR #123 closed by Joe)
include_image true If action is used in a pull request, attach the preview image for it to the card. Can be overridden by custom_image_url
show_author false if action is a Pull request, whether to show the author in the card
colour Colour for the edge of the card in hex
username GitHub Username to send message as
avatar_url Avatar to use for user
custom_image_url Attach custom image to card, overrides pull request image if set. Requires include_image to be true
title_url Make the title of the card this link
name: 'New PR Notification'
on:
  pull_request_target:
    types: [opened, reopened, closed]

jobs:
  notify:
    runs-on: ubuntu-latest
    steps:
      - name: "Check for DISCORD_WEBHOOK"
        id: secrets_set
        env:
          ENABLER_SECRET: ${{ secrets.DISCORD_WEBHOOK }}
        run: |
          unset SECRET_EXISTS
          if [ -n "$ENABLER_SECRET" ]; then SECRET_EXISTS=true ; fi
          echo "SECRETS_ENABLED=$SECRET_EXISTS" >> $GITHUB_OUTPUT
      - name: Send Discord notification
        uses: TiviPlus/discord-notify@v2
        if: steps.secrets_set.outputs.SECRETS_ENABLED
        with:
          webhook_url: ${{ secrets.DISCORD_WEBHOOK }}
          include_image: true
          message: "GET_ACTION"
          avatar_url: https://raw.githubusercontent.com/tgstation/TerraGov-Marine-Corps/refs/heads/master/icons/tgmc_64.png
          username: mpreg emoji test bot
          title_url: "${{ github.event.pull_request.html_url }}"

Screenshot

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 97.0%
  • JavaScript 3.0%