docs: ins/outs and usage in README, update action metadata
This commit is contained in:
parent
0b65351c67
commit
21962ef589
2 changed files with 59 additions and 4 deletions
54
README.md
54
README.md
|
@ -1,2 +1,56 @@
|
||||||
# push-status-to-discord-action
|
# 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
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
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:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
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 }}
|
||||||
|
```
|
||||||
|
|
|
@ -2,23 +2,24 @@ name: Post build status to Discord
|
||||||
|
|
||||||
inputs:
|
inputs:
|
||||||
webhook-url:
|
webhook-url:
|
||||||
description: "Discord webhook URL events should be sent to."
|
description: "Discord webhook url messages should be sent to."
|
||||||
required: true
|
required: true
|
||||||
title:
|
title:
|
||||||
description: "Message title"
|
description: "Discord message title."
|
||||||
default: "${{github.repository}} (Build #${{github.run_number}})"
|
default: "${{github.repository}} (Build #${{github.run_number}})"
|
||||||
status:
|
status:
|
||||||
description: "Status to report."
|
description: "Status to report."
|
||||||
required: true
|
required: true
|
||||||
variant:
|
variant:
|
||||||
|
# See main.py for pre-defined variants.
|
||||||
description: "Style to attach to the message element."
|
description: "Style to attach to the message element."
|
||||||
default: "info"
|
default: "info"
|
||||||
message-id:
|
message-id:
|
||||||
description: "Message ID to post to."
|
description: "Message ID to post to. If specified, the message will be updated instead of creating a new one."
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
message-id:
|
message-id:
|
||||||
description: "Id of the message created, for later edits."
|
description: "ID of the message created or edited."
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: "docker"
|
using: "docker"
|
||||||
|
|
Loading…
Reference in a new issue