Skip to content

v0.1.0

Choose a tag to compare

@github-actions github-actions released this 13 Nov 23:04
· 11 commits to main since this release
162a93f
uses: github.com/mozership/probe-slack@d11a6b6e6908b03c267a888a1e1b6cd187257c65 # v0.1.0

The first release of probe-slack, a Probe action that posts a message to a Slack channel: the notes of a run, a text the workflow writes, or both.

Highlights

  • A step gives the action the notes context of Probe, a text, or both, and it posts one message, by an Incoming Webhook (webhook_url) or with a bot token to the channel the step names (token and channel).
  • The notes show as Block Kit markdown blocks, each with an emoji of its level, its title, its body, and its job, step and status. The plain text of the message holds the same, for notifications and screen readers.
  • With no notes and no text nothing is posted, so a run on a schedule that leaves none sends no message.
  • The URL of a webhook is its secret, so it is told neither in the result, nor in an error, nor in the log of the action.

Posting the notes of a run

A last job, which needs the others with always, reads the notes of them all:

- name: Tell the team
  needs: [checkout]
  always: true
  steps:
  - name: Post the critical notes
    uses: slack
    with:
      webhook_url: "{{vars.slack_webhook}}"
      text: Critical notes of the nightly run
      notes: "{{ filter(notes, .level == 'critical') }}"

The message it posts:

Critical notes of the nightly run

**The run left 1 note: 1 critical.**

🚨 **critical · The checkout button is under the cookie banner**

On a 390px wide screen the banner covers the button until it is closed.

_Checkout › A first-time shopper · passed_

Each run posts a new message; a message kept up to date for each push belongs on the pull request, with probe-github-notes. A value Probe hides, <secret:NAME> or <redacted>, is put in code, as Slack would take it for a link or a mention. A message longer than Slack takes, 50 blocks and 12000 characters of markdown, leaves out its last notes and says how many. An error of Slack, such as channel_not_found, fails the step with what Slack answered.

Under --read-only a post is refused, and under --allow-host the host of the webhook or the API is checked.

Requirements

The action needs Probe v1.32.0 or later, the first with the notes context. See the README.

Changelog

  • fdd73b7 Cut the plain text after escaping it, and not inside an entity
  • c5b4a47 Escape masks by paragraph, and tell only the errors of Slack from a webhook
  • 50a1ff5 Keep a mask apart from a code span next to it, and expect the longer span
  • fe84045 Keep the webhook and the token out of the log, and masks in their spans
  • 162a93f Merge pull request #1 from mozership/feat/action
  • 75028db Post a message to a Slack channel, of the notes of a run or a text
  • 50d21ec Start probe-slack with its license
  • d0ee34d Tell the notes in the plain text too, and no more than the host in an error