Skip to content

Commit

Permalink
feat: allow including only failed jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
atammy-narmi committed May 9, 2024
1 parent 68bf00d commit 60b44a9
Show file tree
Hide file tree
Showing 8 changed files with 38,129 additions and 13,287 deletions.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use nvm --auto
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20.11
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This action will post workflow status notifications into your Slack channel. The
| **slack_webhook_url** | _required_ | Create a Slack Webhook URL using the [Incoming Webhooks App](https://slack.com/apps/A0F7XDUAZ-incoming-webhooks?next_id=0). It is recommended that you create a new secret on your repo `SLACK_WEBHOOK_URL` for holding this value, and passing it to the action with `${{secrets.SLACK_WEBHOOK_URL}}`.
| **repo_token** | _required_ | A token is automatically available in your workflow secrets var. `${{secrets.GITHUB_TOKEN}}`. You can optionally send an alternative self-generated token.
| **include_jobs** | _optional_ | When set to `true`, include individual job status and durations in the slack notification. When `false` only the event status and workflow status lines are included. When set to `on-failure` — individual job status is reported only if workflow failed. Default is `true`.
| **jobs_to_fetch** | _optional_ | Sets the number of jobs to fetch (for workflows with big number of jobs). Default is 30.
| **jobs_to_include** | _optional_ | Should all jobs be included or only the ones that failed. When set to `failed` only the failed jobs are included in the message. the Default is `all`.
| **include_commit_message** | _optional_ | When set to `true`, include the workflow head commit message title in the slack notification. Default is `false`.
| **channel** | _optional_ | Accepts a Slack channel name where you would like the notifications to appear. Overrides the default channel created with your webhook.
| **name** | _optional_ | Allows you to provide a name for the slack bot user posting the notifications. Overrides the default name created with your webhook.
Expand Down
10 changes: 7 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,18 @@ inputs:
description: 'Should the slack notification include individual job status and run times'
required: true
default: "true"
jobs_to_include:
description: 'Should all jobs be included or only the ones that failed'
required: true
default: "all"
include_commit_message:
description: 'Should the slack notification include the head commit message'
required: true
default: "false"
jobs_to_fetch:
description: 'Number of jobs to fetch (for workflows with big number of jobs)'
custom_message:
description: 'Custom message to include in the slack notification'
required: false
default: '30'
default: ""
runs:
using: 'node20'
main: 'dist/index.js'
45,065 changes: 35,494 additions & 9,571 deletions dist/index.js

Large diffs are not rendered by default.

Loading

0 comments on commit 60b44a9

Please sign in to comment.