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

Repository files navigation

Send Notification Message to IRC

Usage

See action.yml For comprehensive list of options.

This is a fork of https://github.com/rectalogic/notify-irc but I had issues getting it to send multiline messages. This has been tweaked to issue IRC notifications mimicking the style of n.tkte.ch's Notifico.

Jorgen Lundman lundman@lundman.net

V1: Add --ansicolor

V2: Add --mirccolor

  • It seems MIRC color works in more IRC clients than ANSI.

Unreleased:

  • server may be a comma separated list of host[:port], tried in order until one delivers, and each attempt gets timeout seconds (default 15) instead of asyncio's 60 second TLS handshake wait. The action fails only if every server fails.
  • only_repository: owner/repo patterns. On any other repository the action does nothing, so a fork that copies the workflow stays quiet.
  • Issue, PR and comment messages name the person who acted (sender), not the author of the issue or PR.
  • Pushes report the real commit count. GitHub truncates the event to 20 commits, so the compare API is used (github_token, defaults to the workflow token); if that is unavailable the count shows as 20+.
  • PR messages link to the PR.

Example, send notifications to Libera Chat IRC channel:

name: Notify IRC

on:
  push:
  issues:
    types:
      - opened
      - edited
      - closed
  issue_comment:
  pull_request:
  discussion:
    types:
      - created
      - edited
      - closed
      - answered
  discussion_comment:
  create:
  delete:

jobs:
  notify-irc:
    runs-on: ubuntu-latest

    steps:
      - name: Notify IRC
        uses: openzfsonwindows/notify-irc@v2
        with:
          channel: "#yourchannel"
          # Tried in order; a stalled server no longer fails the run
          server: "irc.libera.chat,irc.eu.libera.chat"
          # Stay quiet on forks that copy this workflow
          only_repository: "yourorg/yourrepo"
          nickname: "irc-bot-name"
          mirccolor: "true"
          eventpath: ${{ github.event_path }}

Screenshot

Handling Pull Requests: pull_request vs. pull_request_target

GitHub provides two different event types for pull requests:

pull_request

Runs in the context of the contributor’s fork. Requires manual approval for first-time contributors (i.e., actions won't trigger until approved). Best for workflows that need to inspect the PR’s contents safely (e.g., linting, tests).

pull_request_target

Runs in the context of the base repository (not the contributor’s fork). Does not require manual approval—PR events (opened, synchronized, etc.) will trigger immediately, even from forks. Best for workflows that don’t need to inspect untrusted code (e.g., sending notifications, labeling PRs).

For this GitHub Action (notify-irc), we use pull_request_target instead of pull_request to ensure that PR notifications are always sent to IRC, even from first-time contributors.

About

Github actions

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages