Skip to content

Commit

Permalink
Add slack notification action
Browse files Browse the repository at this point in the history
  • Loading branch information
Mondlicht1 committed Mar 7, 2024
1 parent 82fa305 commit 9d8a0d9
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions notify-slack/action.yml
@@ -0,0 +1,41 @@
name: 'Slack Notification'
description: 'Send notifications to Slack'
inputs:
slack-webhook:
description: 'Slack webhook URL'
required: true
slack-username:
description: 'Username to display in the message'
required: true
slack-channel:
description: 'Slack channel to post the message'
required: true
title:
description: 'Message title'
required: true
text:
description: 'Message text'
required: true
color:
description: 'Color of the message'
required: false
default: 'Good'

runs:
using: composite
steps:
- name: Notify Slack Channel
shell: bash
run: |
curl "${{ inputs.slack-webhook }}" "-XPOST -H 'Content-Type: application/json'"

Check failure on line 30 in notify-slack/action.yml

View workflow job for this annotation

GitHub Actions / Check Spelling

`XPOST` is not a recognized word. (unrecognized-spelling)

Check notice on line 30 in notify-slack/action.yml

View workflow job for this annotation

GitHub Actions / Check Spelling

`Line` matches candidate pattern `(?:^|[\t ,"'`=(])-[DPWXYLlf](?=[A-Z]{2,}|[A-Z][a-z]|[a-z]{2,})` (candidate-pattern)

Check failure on line 30 in notify-slack/action.yml

View workflow job for this annotation

GitHub Actions / Check Spelling

`XPOST` is not a recognized word. (unrecognized-spelling)

Check notice on line 30 in notify-slack/action.yml

View workflow job for this annotation

GitHub Actions / Check Spelling

`Line` matches candidate pattern `(?:^|[\t ,"'`=(])-[DPWXYLlf](?=[A-Z]{2,}|[A-Z][a-z]|[a-z]{2,})` (candidate-pattern)
--data '{
"username": "${{ inputs.slack-username }}",
"channel": "${{ inputs.slack-channel }}",
"attachments": [
{
"title": "${{ inputs.title }}",
"text": "${{ inputs.text }}",
"color": "${{ inputs.color }}"
}
]
}'

1 comment on commit 9d8a0d9

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@check-spelling-bot Report

🔴 Please review

See the 📜action log or 📝 job summary for details.

Unrecognized words (1)

XPOST

To accept these unrecognized words as correct, you could run the following commands

... in a clone of the git@github.com:GarnerCorp/build-actions.git repository
on the notify-slack-action branch (ℹ️ how do I use this?):

curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/prerelease/apply.pl' |
perl - 'https://github.com/GarnerCorp/build-actions/actions/runs/8190696049/attempts/1'
Available 📚 dictionaries could cover words (expected and unrecognized) not in the 📘 dictionary

This includes both expected items (26) from .github/actions/spelling/expect.txt and unrecognized words (1)

Dictionary Entries Covers Uniquely
cspell:aws/aws.txt 218 1 1
cspell:fullstack/dict/fullstack.txt 419 1 1
cspell:node/dict/node.txt 891 1 1
cspell:php/dict/php.txt 1689 1 1
cspell:golang/dict/go.txt 2099 1 1

Consider adding them (in .github/workflows/spelling.yml) in jobs:/comment: for uses: check-spelling/check-spelling@prerelease in its with:

      with:
        extra_dictionaries:
          cspell:aws/aws.txt
          cspell:fullstack/dict/fullstack.txt
          cspell:node/dict/node.txt
          cspell:php/dict/php.txt
          cspell:golang/dict/go.txt

To stop checking additional dictionaries, add (in .github/workflows/spelling.yml) for uses: check-spelling/check-spelling@prerelease in its with:

check_extra_dictionaries: ''
Pattern suggestions ✂️ (1)

You could add these patterns to .github/actions/spelling/patterns.txt:

# Automatically suggested patterns
# hit-count: 1 file-count: 1
# Compiler flags
(?:^|[\t ,"'`=(])-[DPWXYLlf](?=[A-Z]{2,}|[A-Z][a-z]|[a-z]{2,})

Warnings (1)

See the 📜action log or 📝 job summary for details.

ℹ️ Warnings Count
ℹ️ candidate-pattern 1

See ℹ️ Event descriptions for more information.

If the flagged items are false positives

If items relate to a ...

  • binary file (or some other file you wouldn't want to check at all).

    Please add a file path to the excludes.txt file matching the containing file.

    File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.

    ^ refers to the file's path from the root of the repository, so ^README\.md$ would exclude README.md (on whichever branch you're using).

  • well-formed pattern.

    If you can write a pattern that would match it,
    try adding it to the patterns.txt file.

    Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.

    Note that patterns can't match multiline strings.

Please sign in to comment.