No description
Find a file
Marc Cataford c56f1c827e
Some checks failed
/ Dynamic analysis (push) Failing after 45s
/ Static analysis (push) Failing after 37s
ci: add static+dynamic analysis steps on push
2024-07-27 15:03:58 -04:00
.forgejo/workflows ci: add static+dynamic analysis steps on push 2024-07-27 15:03:58 -04:00
action.yml ci: add static+dynamic analysis steps on push 2024-07-27 15:03:58 -04:00
Dockerfile fix: check if message_id is truthy instead of None before using it 2024-07-24 20:35:18 -04:00
LICENSE Initial commit 2024-07-20 03:20:23 +00:00
main.py fix: check if message_id is truthy instead of None before using it 2024-07-24 20:35:18 -04:00
README.md docs: ins/outs and usage in README, update action metadata 2024-07-24 22:06:14 -04:00
requirements.txt refactor: tidy composite action into docker-based action 2024-07-24 19:36:35 -04:00

push-status-to-discord-action

Overview

Posts build statuses to Discord via webhooks. If a message ID is provided when invoking, the specified message will be edited instead of creating a new one, keeping reporting channels tidy.

Inputs & outputs

inputs:
  webhook-url:
    description: "Discord webhook url messages should be sent to."
    required: true
  title:
    description: "Discord message title."
    default: "${{github.repository}} (Build #${{github.run_number}})"
  status:
    description: "Status to report."
    required: true
  variant:
    # See main.py for pre-defined variants.
    description: "Style to attach to the message element."
    default: "info"
  message-id:
    description: "Message ID to post to. If specified, the message will be updated instead of creating a new one."

outputs:
  message-id:
    description: "ID of the message created or edited."

Usage

Unless a message-id input is provided, new messages are created on every invocation. The message ID can be passed around between jobs using the @actions/upload-artifact and @actions/download-artifact actions:

jobs:
    job1:
        - uses: https://forge.karnov.club/marc/push-status-to-discord@main
          id: post-message
        - run: echo "${{ steps.post-message.outputs.message-id }}" >> /tmp/some-file
        - uses: @actions/upload-artifact
          with:
            path: /tmp/some-file
            name: some-name
    job2:
        - uses: @actions/download-artifact
          with:
            path: /tmp
            name: some-name
        - run: echo "message-id=$(cat /tmp/some-file)" >> $GITHUB_OUTPUT
          id: get-message-id
        - uses: https://forge.karnov.club/marc/push-status-to-discord@main
          with:
            message-id: ${{ steps.get-message-id.outputs.message-id }}