Skip to content

Commit

Permalink
Merge pull request #43 from sue445/act10ns-slack
Browse files Browse the repository at this point in the history
Migrate to act10ns/slack
  • Loading branch information
sue445 committed Sep 6, 2023
2 parents da8982a + b0d82c7 commit 859042d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 18 deletions.
11 changes: 11 additions & 0 deletions .github/slack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# c.f. https://github.com/act10ns/slack/blob/master/.github/slack.yml

text: |
*<{{workflowRunUrl}}|Workflow _{{workflow}}_ job _{{jobName}}_ triggered by _{{eventName}}_ is _{{jobStatus}}_>* for <{{refUrl}}|`{{ref}}`>
{{#if description}}<{{diffUrl}}|`{{diffRef}}`> - {{{description}}}{{/if}}
{{#if payload.commits}}
*Commits*
{{#each payload.commits}}
<{{this.url}}|`{{truncate this.id 8}}`> - {{this.message}}
{{/each}}
{{/if}}
9 changes: 3 additions & 6 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,9 @@ jobs:
uses: actions/deploy-pages@main

- name: Slack Notification (not success)
uses: lazy-actions/slatify@master
uses: act10ns/slack@v2
if: "! success()"
continue-on-error: true
with:
job_name: "*pages*"
type: ${{ job.status }}
icon_emoji: ":octocat:"
url: ${{ secrets.SLACK_WEBHOOK }}
token: ${{ secrets.GITHUB_TOKEN }}
status: ${{ job.status }}
webhook-url: ${{ secrets.SLACK_WEBHOOK }}
19 changes: 7 additions & 12 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,13 @@ jobs:
- run: bundle exec rspec

- name: Slack Notification (not success)
uses: lazy-actions/slatify@master
uses: act10ns/slack@v2
if: "! success()"
continue-on-error: true
with:
job_name: ${{ format('*build* ({0})', matrix.ruby) }}
type: ${{ job.status }}
icon_emoji: ":octocat:"
url: ${{ secrets.SLACK_WEBHOOK }}
token: ${{ secrets.GITHUB_TOKEN }}
status: ${{ job.status }}
webhook-url: ${{ secrets.SLACK_WEBHOOK }}
message: "*<{{workflowRunUrl}}|_{{jobName}}_ (${{matrix.ruby}}) is _{{jobStatus}}_>*"

rbs:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -84,12 +82,9 @@ jobs:

steps:
- name: Slack Notification (success)
uses: lazy-actions/slatify@master
uses: act10ns/slack@v2
if: always()
continue-on-error: true
with:
job_name: '*build*'
type: ${{ job.status }}
icon_emoji: ":octocat:"
url: ${{ secrets.SLACK_WEBHOOK }}
token: ${{ secrets.GITHUB_TOKEN }}
status: ${{ job.status }}
webhook-url: ${{ secrets.SLACK_WEBHOOK }}

0 comments on commit 859042d

Please sign in to comment.