[前][次][番号順一覧][スレッド一覧]

ruby-changes:74253

From: Takashi <ko1@a...>
Date: Wed, 26 Oct 2022 13:51:01 +0900 (JST)
Subject: [ruby-changes:74253] 923aed26ff (master): Start notifying Cirrus CI failures

https://git.ruby-lang.org/ruby.git/commit/?id=923aed26ff

From 923aed26ff217f0b5619d5c53c24be7e0823b951 Mon Sep 17 00:00:00 2001
From: Takashi Kokubun <takashikkbn@g...>
Date: Tue, 25 Oct 2022 21:49:35 -0700
Subject: Start notifying Cirrus CI failures

It looks like Cirrus doesn't natively support notifications and they
recomment to use GitHub Actions for it.
https://cirrus-ci.org/guide/notifications/

Because I don't know what the payload looks like, I just added a basic
payload and dumped GitHub context so that we could improve it later.
---
 .github/workflows/cirrus-notify.yml | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)
 create mode 100644 .github/workflows/cirrus-notify.yml

diff --git a/.github/workflows/cirrus-notify.yml b/.github/workflows/cirrus-notify.yml
new file mode 100644
index 0000000000..156fd529f8
--- /dev/null
+++ b/.github/workflows/cirrus-notify.yml
@@ -0,0 +1,29 @@ https://github.com/ruby/ruby/blob/trunk/.github/workflows/cirrus-notify.yml#L1
+on:
+  check_suite:
+    type: ['completed']
+name: Cirrus CI failure notification
+jobs:
+  cirrus-notify:
+    name: After Cirrus CI Failure
+    if: >-
+      github.event.check_suite.app.name == 'Cirrus CI'
+      && github.event.check_suite.conclusion != 'success'
+      && github.event.check_suite.conclusion != 'cancelled'
+    runs-on: ubuntu-latest
+    steps:
+      - name: Dump GitHub context
+        env:
+          GITHUB_CONTEXT: ${{ toJson(github) }}
+        run: echo "$GITHUB_CONTEXT"
+      - uses: ruby/action-slack@v...
+        with:
+          payload: |
+            {
+              "ci": "Cirrus CI",
+              "env": "Cirrus CI",
+              "url": "https://cirrus-ci.com/github/ruby/ruby",
+              "commit": "${{ github.sha }}",
+              "branch": "${{ github.ref_name }}"
+            }
+        env:
+          SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
-- 
cgit v1.2.3


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]