Just print the commit subject line
This commit is contained in:
parent
43f7e5d9b8
commit
9f4f356f81
1 changed files with 14 additions and 12 deletions
26
.github/workflows/irc-notify.yml
vendored
26
.github/workflows/irc-notify.yml
vendored
|
@ -12,13 +12,14 @@ jobs:
|
|||
notify:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: rectalogic/notify-irc@v1
|
||||
- name: Prepare message
|
||||
if: github.event_name == 'push'
|
||||
env:
|
||||
BOLD: ${{ fromJSON('"\u0002"') }}
|
||||
COLOR: ${{ fromJSON('"\u0003"') }}
|
||||
BLUE: 02
|
||||
PURPLE: 06
|
||||
SILVER: 15
|
||||
MSG: ${{ github.event.head_commit.message }}
|
||||
run: |
|
||||
printf COMMIT_SUBJECT=%s "${MSG}" | head -n 1 >> "$GITHUB_ENV"
|
||||
- uses: rectalogic/notify-irc@v1
|
||||
env: { COLOR: "\x03", BLUE: "02", PURPLE: "06", ACTOR: "\x0315${{ github.actor }}\x03" }
|
||||
with:
|
||||
channel: ${{ vars.IRC_CHANNEL }}
|
||||
server: ${{ vars.IRC_SERVER }}
|
||||
|
@ -29,14 +30,15 @@ jobs:
|
|||
# github.event data: https://docs.github.com/en/webhooks-and-events/webhooks/webhook-events-and-payloads
|
||||
message: >-
|
||||
${{ (github.event_name == 'push' &&
|
||||
format('{0}{1}{2}{0} {3} {0}{4}{5}{0}: {6}: {0}{7}{8}{0}', env.COLOR, env.SILVER, github.actor,
|
||||
format('{1} {2} {0}{3}{4}{0}: {5}: {0}{6}{7}{0}', env.COLOR, env.ACTOR,
|
||||
(github.event.created && (github.event.tag && 'tagged' || 'created')) || (github.event.deleted && 'deleted') || (github.event.forced && 'force-pushed to') || 'pushed to',
|
||||
env.PURPLE, github.ref_name, github.event.head_commit.message, env.BLUE, github.event.compare)
|
||||
) || (github.event_name == 'pull_request' &&
|
||||
format('{0}{1}{2}{0} {3} PR {0}{4}#{5}{0}: {6}: {0}{7}{8}{0}', env.COLOR, env.SILVER, github.actor, github.event.action, env.PURPLE, github.event.number, github.event.pull_request.title, env.BLUE, github.event.pull_request.html_url)
|
||||
env.PURPLE, github.ref_name, env.COMMIT_SUBJECT, env.BLUE, github.event.compare)
|
||||
) || (github.event_name == 'pull_request_target' &&
|
||||
format('{1} {2} PR #{3} for {0}{4}{5}{0}: {6}: {0}{7}{8}{0}', env.COLOR, env.ACTOR, github.event.action, github.event.number, env.PURPLE, github.base_ref, github.event.pull_request.title, env.BLUE, github.event.pull_request.html_url)
|
||||
) || (github.event_name == 'issues' &&
|
||||
format('{0}{1}{2}{0} {3} issue {0}{4}#{5}{0}: {6}: {0}{7}{8}{0}', env.COLOR, env.SILVER, github.actor, github.event.action, env.PURPLE, github.event.issue.number, github.event.issue.title, env.BLUE, github.event.issue.html_url)
|
||||
format('{1} {2} issue {0}{3}#{4}{0}: {5}: {0}{6}{7}{0}', env.COLOR, env.ACTOR, github.event.action, env.PURPLE, github.event.issue.number, github.event.issue.title, env.BLUE, github.event.issue.html_url)
|
||||
) || ((github.event_name == 'create' || github.event_name == 'delete') &&
|
||||
format('{0}{1}{2}{0} {3}d {4} {0}{5}{6}{0}', env.COLOR, env.SILVER, github.actor, github.event_name, github.event.ref_type, env.PURPLE, github.event.ref)
|
||||
format('{1} {2}d {3} {0}{4}{5}{0}', env.COLOR, env.ACTOR, github.event_name, github.event.ref_type, env.PURPLE, github.event.ref)
|
||||
)
|
||||
}}
|
||||
_debug: ${{ toJSON(github) }}
|
||||
|
|
Loading…
Add table
Reference in a new issue