Git Product home page Git Product logo

irc-message-action's Introduction

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

irc-message-action's People

Contributors

dependabot[bot] avatar dominusexult avatar gottox avatar jesopo avatar the-compiler avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

irc-message-action's Issues

Bundled macos-release module missing Monterey

Hi!

I'm testing the beta version of GitHub's macOS-12 runner and I'm hitting a weird traceback I can't figure out, with irc-message-action. It's entirely likely that this is an issue with github's new runner environment, but I wanted to mention it here in case this is a subtle incompatibility with newer things. If it helps, the various versions in the macOS-12 runner are listed here

Run Gottox/[email protected]
  with:
    channel: #hammerspoon
    nickname: HSGHA
    message: CI for https://github.com/Hammerspoon/hammerspoon/compare/518187c230f7...6eda506cd553 (Chris Jones):
    * Update Xcode version too
    * 	 Executed 302 tests, with 50 tests skipped and 2 failures (0 unexpected) in 672.422 (672.791) seconds
  
    server: irc.libera.chat
    port: 6697
    notice: false
    tls: true
    response_timeout: 60
    excess_flood: throttle
    debug: false
  env:
    IS_CI: 1

/Users/runner/work/_actions/Gottox/irc-message-action/v2.1.0/node_modules/@octokit/rest/node_modules/universal-user-agent/dist-node/index.js:17
    throw error;
    ^

TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator))
    at macosRelease (/Users/runner/work/_actions/Gottox/irc-message-action/v2.1.0/node_modules/macos-release/index.js:26:26)
    at osName (/Users/runner/work/_actions/Gottox/irc-message-action/v2.1.0/node_modules/os-name/index.js:21:18)
    at getUserAgent (/Users/runner/work/_actions/Gottox/irc-message-action/v2.1.0/node_modules/@octokit/rest/node_modules/universal-user-agent/dist-node/index.js:11:53)
    at parseOptions (/Users/runner/work/_actions/Gottox/irc-message-action/v2.1.0/node_modules/@octokit/rest/lib/parse-client-options.js:80:57)
    at new Octokit (/Users/runner/work/_actions/Gottox/irc-message-action/v2.1.0/node_modules/@octokit/rest/lib/constructor.js:23:31)
    at Object.<anonymous> (/Users/runner/work/_actions/Gottox/irc-message-action/v2.1.0/node_modules/@actions/github/lib/github.js:16:28)
    at Module._compile (internal/modules/cjs/loader.js:999:[30](https://github.com/Hammerspoon/hammerspoon/runs/5760587740?check_suite_focus=true#step:12:30))
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:[32](https://github.com/Hammerspoon/hammerspoon/runs/5760587740?check_suite_focus=true#step:12:32))
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)

Cannot find module '.../is-plain-object.js'

Since the recent update (I think), this action always seems to fail for me:

internal/modules/cjs/loader.js:305
      throw err;
      ^

Error: Cannot find module '/home/runner/work/_actions/Gottox/irc-message-action/v1/node_modules/is-plain-object/dist/is-plain-object.js'. Please verify that the package.json has a valid "main" entry
    at tryPackage (internal/modules/cjs/loader.js:297:19)
    at Function.Module._findPath (internal/modules/cjs/loader.js:528:18)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:784:27)
    at Function.Module._load (internal/modules/cjs/loader.js:690:27)
    at Module.require (internal/modules/cjs/loader.js:852:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/home/runner/work/_actions/Gottox/irc-message-action/v1/node_modules/@octokit/endpoint/dist-node/index.js:5:21)
    at Module._compile (internal/modules/cjs/loader.js:959:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
    at Module.load (internal/modules/cjs/loader.js:815:32) {
  code: 'MODULE_NOT_FOUND',
  path: '/home/runner/work/_actions/Gottox/irc-message-action/v1/node_modules/is-plain-object/package.json',
  requestPath: 'is-plain-object'
}

Fails with excess flood when the message is multiline

I've got Comit message: ${{github.event.head_commit.message}} as a part of bot's message, and commit messages can be multiline. When the number of line is a bit high (10?) the bot fails to transmit anything and there's this in the logs

ERROR :Closing Link: 1.2.3.4 (Excess Flood)

Update to Node 20

GitHub started to complain about Node 16 being outdated.
Updating to Node 20 would solve this.

Error

No event triggers defined in 'on' i get how do i fix

Colored output?

Hey! ๐Ÿ‘‹

Do you know if it's possible to get colored IRC messages? Based on the mIRC color escapes I tried:

        message: |-
          \0033[${{ github.workflow }}] Success: ${{ github.ref }} https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} triggered by ${{ github.actor }}\003

But that only lead to a literal \003 in the message:

13:51 <qutebrowser-bot> \0033[CI] Success: refs/heads/master https://github.com/qutebrowser/qutebrowser/actions/runs/159237141 triggered by The-Compiler\003

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.