Skip to content

Github Action to Interact with IRC Channels and Users

Notifications You must be signed in to change notification settings

Gottox/irc-message-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IRC Message Action

This action prints a message to a given IRC Channel. Optionally it waits for a response from a given user

Inputs

server

The hostname of the IRC server

default: 'irc.libera.chat'

port

The port number of the IRC server

default: 6697

channel

Required IRC channel that will receive the messages

channel_key

IRC channel password

nickname

Required IRC nickname

sasl_password

IRC SASL password

message

Required Message to send

notice

Use NOTICE instead of PRIVMSG

default: false

tls

Use TLS to connect to the IRC server

default: true

response_allow_from

Comma seperated list of authenticated accounts allowed to response to an action

response_timeout

Timeout to wait for a response in seconds

default: 60

excess_flood

Prevention strategy for excess flooding a channel Either "throttle" or "truncate".

  • truncate: cuts off the message after 3 lines.

  • throttle: sends only 1 line per second.

    default: "throttle"

debug

Enables verbose output.

default: false

Outputs

response_from

nickname of the responding user

response

Response written from an authenticated user

Example usage

Example 1: Simple IRC notification of pushes

on: [push]

jobs:
  notification:
    runs-on: ubuntu-latest
    name: Notifications
    steps:
    - name: IRC notification
      uses: Gottox/irc-message-action@v2
      with:
        channel: '##mychannel'
        nickname: mynickname
        message: |-
          ${{ github.actor }} pushed ${{ github.event.ref }} ${{ github.event.compare }}

Example 2: Acknowledge an action via IRC

on: [push]

jobs:
  deploy:
    runs-on: ubuntu-latest
    name: Deploy Chain
    steps:
    - name: Acknowledge
      id: acknowledge
      uses: Gottox/irc-message-action@v2
      with:
        channel: '##mychannel'
        nickname: mynickname
        response_allow_from: Operator1, Operator2, Operator3
        # 5 hours:
        response_timeout: 18000
        message: |-
          ${{ github.actor }} pushed something: ${{ github.event.compare }}
          Please acknowledge with "ok"!
    # An Acknowledger can reply to this with "mynickname: ok"
    - name: Print Acknowledger
      run: echo "${{ steps.response.outputs.response_from }}"
    - name: Check Acknowledge
      run: test "${{ steps.response.outputs.response }}" = "ok"
    - name: Deploy
      run: ./deploy.sh