Skip to content

Commit

Permalink
Make Slack Message Broker Workflow Trigger on Status Events (#6544)
Browse files Browse the repository at this point in the history
  • Loading branch information
zeme-wana authored Oct 8, 2024
1 parent 9c09fa4 commit ff566b3
Showing 1 changed file with 38 additions and 10 deletions.
48 changes: 38 additions & 10 deletions .github/workflows/slack-message-broker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
name: "📮 Slack Message Broker"

on:
check_run:
types: [completed]

status:

jobs:
Send:
runs-on: [ubuntu-latest]
Expand All @@ -17,14 +16,43 @@ jobs:
script: |
console.log(${{ toJson(github.event) }});
const sender = "${{ github.event.sender.login }}";
const name = "${{ github.event.check_run.name }}";
const status = "${{ github.event.check_run.status }}";
const conclusion = "${{ github.event.check_run.conclusion }}";
const url = "${{ github.event.check_run.html_url }}";
const state = github.event.state;
const statusContext = github.event.context;
const contextDescription = github.event.description;
const targetUrl = github.event.target_url
const commitUrl = github.event.commit.html_url;
const commitSha = github.event.commit.sha.slice(0, 9);
const senderLogin = github.event.sender.login;
function getSlackMemberToBeNotified() {
const slackMemberIds = {
"zeme-wana": "U03HGDNDRKR",
"effecfully": "UBH8K0ZU2",
"kwxm": "UCF4SL4BT",
"Unisay": "U02V796524S",
"ramsay-t": "U05T49F9FV1",
"ana-pantilie": "U05V2854W86",
"zliu41": "U03BP2HTKDK",
"bezirg": "UQ1LUSR8B"
};
if (senderLogin in slackMemberIds) {
return `<@${slackMemberIds[senderLogin]}>`;
} else {
return "@here";
}
}
let message = `${name} \`${conclusion}\` <${url}|View Logs> @${sender}`;
let shouldSendMessage = conclusion == "failure";
let message;
let shouldSendMessage;
if (["failure", "error"].includes(state)) {
message = `🔴 ${getSlackMemberToBeNotified()} your commit <${commitUrl}|\`${commitSha}\`> failed <${targetUrl}|${statusContext}>.`
shouldSendMessage = true;
}
else {
message = `🟢 ${getSlackMemberToBeNotified()} your commit <${commitUrl}|\`${commitSha}\`> passed <${targetUrl}|${statusContext}>.`
shouldSendMessage = false;
}
console.log(`message: ${message}`);
console.log(`shouldSendMessage: ${shouldSendMessage}`);
Expand Down

1 comment on commit ff566b3

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Plutus Benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.05.

Benchmark suite Current: ff566b3 Previous: 9c09fa4 Ratio
validation-auction_1-2 848.8 μs 646.5 μs 1.31
validation-auction_1-3 902 μs 637.9 μs 1.41
validation-auction_1-4 329.2 μs 230.7 μs 1.43
validation-auction_2-1 258.7 μs 181 μs 1.43
validation-auction_2-2 913.3 μs 642.8 μs 1.42
validation-auction_2-3 1192 μs 839.5 μs 1.42
validation-auction_2-4 903.3 μs 636.7 μs 1.42
validation-auction_2-5 329.6 μs 232.2 μs 1.42
validation-escrow-redeem_2-2 580.7 μs 410 μs 1.42
validation-escrow-redeem_2-3 581.7 μs 410.8 μs 1.42
validation-escrow-refund-1 222.9 μs 155.9 μs 1.43
validation-future-increase-margin-1 356.5 μs 248.1 μs 1.44
validation-future-increase-margin-2 766.8 μs 542.9 μs 1.41
validation-future-increase-margin-3 768.3 μs 540.5 μs 1.42
validation-future-increase-margin-4 696.7 μs 528.3 μs 1.32
validation-future-pay-out-1 353.5 μs 308.1 μs 1.15
validation-future-pay-out-2 765 μs 538.3 μs 1.42
validation-future-pay-out-3 767.2 μs 698.1 μs 1.10
validation-future-pay-out-4 1163 μs 848.9 μs 1.37
validation-future-settle-early-4 862.5 μs 672.9 μs 1.28
validation-game-sm-success_1-1 553.9 μs 389 μs 1.42
validation-game-sm-success_1-2 285.8 μs 200.4 μs 1.43
validation-game-sm-success_1-3 911.9 μs 663.3 μs 1.37
validation-game-sm-success_1-4 331.5 μs 253.6 μs 1.31
validation-game-sm-success_2-1 554.2 μs 390.3 μs 1.42
validation-game-sm-success_2-2 286.9 μs 231.2 μs 1.24
validation-game-sm-success_2-4 331.4 μs 291.1 μs 1.14
validation-multisig-sm-2 549.9 μs 511.7 μs 1.07
validation-multisig-sm-3 561.4 μs 476.3 μs 1.18
validation-multisig-sm-6 569 μs 526.2 μs 1.08
validation-pubkey-1 151.5 μs 142.4 μs 1.06
validation-stablecoin_1-1 1162 μs 912.6 μs 1.27
validation-stablecoin_1-2 279.5 μs 221.8 μs 1.26
validation-stablecoin_1-6 269.1 μs 255 μs 1.06
validation-stablecoin_2-1 1286 μs 914 μs 1.41
validation-stablecoin_2-2 279.6 μs 195.5 μs 1.43
validation-stablecoin_2-3 1494 μs 1091 μs 1.37
validation-decode-auction_2-2 752 μs 525 μs 1.43
validation-decode-crowdfunding-success-3 327.7 μs 235.5 μs 1.39
validation-decode-future-increase-margin-2 438.3 μs 353.7 μs 1.24
validation-decode-future-increase-margin-3 438.8 μs 314.1 μs 1.40
validation-decode-future-increase-margin-4 959.7 μs 690.8 μs 1.39
validation-decode-future-increase-margin-5 959.5 μs 757.8 μs 1.27
validation-decode-future-pay-out-3 438.4 μs 338.8 μs 1.29
validation-decode-future-pay-out-4 938.2 μs 683.5 μs 1.37
validation-decode-future-settle-early-1 329.3 μs 235.9 μs 1.40
validation-decode-future-settle-early-2 439 μs 314 μs 1.40
validation-decode-future-settle-early-3 439.3 μs 313.6 μs 1.40
validation-decode-future-settle-early-4 959.9 μs 673.1 μs 1.43
validation-decode-game-sm-success_1-1 714.2 μs 524.7 μs 1.36
validation-decode-game-sm-success_1-2 225.7 μs 162.4 μs 1.39
validation-decode-game-sm-success_1-3 714.8 μs 524.7 μs 1.36
validation-decode-game-sm-success_1-4 225.8 μs 161.6 μs 1.40
validation-decode-game-sm-success_2-1 713.7 μs 523.4 μs 1.36
validation-decode-game-sm-success_2-2 225.6 μs 162.1 μs 1.39
validation-decode-game-sm-success_2-3 715.1 μs 523.8 μs 1.37
validation-decode-game-sm-success_2-4 225.2 μs 162.6 μs 1.38
validation-decode-game-sm-success_2-5 710.7 μs 508 μs 1.40
validation-decode-game-sm-success_2-6 225.1 μs 164.3 μs 1.37
validation-decode-multisig-sm-1 792.7 μs 633.5 μs 1.25
validation-decode-multisig-sm-2 805.2 μs 582.7 μs 1.38
validation-decode-multisig-sm-3 804.6 μs 570.3 μs 1.41
validation-decode-multisig-sm-4 802.6 μs 577.4 μs 1.39
validation-decode-multisig-sm-5 789.8 μs 582.4 μs 1.36
validation-decode-multisig-sm-6 810.7 μs 567.6 μs 1.43
validation-decode-multisig-sm-7 772.7 μs 571.4 μs 1.35
validation-decode-uniswap-4 199 μs 188.1 μs 1.06
nofib-clausify/formula3 13370 μs 11090 μs 1.21
nofib-primetest/10digits 28220 μs 21970 μs 1.28
nofib-queens4x4/bjbt1 9011 μs 7806 μs 1.15
nofib-queens4x4/fc 19140 μs 14250 μs 1.34
nofib-queens5x5/bt 101100 μs 71320 μs 1.42
nofib-queens5x5/bm 106000 μs 74890 μs 1.42
nofib-queens5x5/bjbt1 118100 μs 83170 μs 1.42
nofib-queens5x5/bjbt2 114800 μs 80890 μs 1.42
nofib-queens5x5/fc 243500 μs 171800 μs 1.42
marlowe-semantics/28fdce478e179db0e38fb5f3f4105e940ece450b9ce8a0f42a6e313b752e6f2c 1348 μs 941 μs 1.43
marlowe-semantics/55dfe42688ad683b638df1fa7700219f00f53b335a85a2825502ab1e0687197e 435.6 μs 397.5 μs 1.10
marlowe-semantics/56333d4e413dbf1a665463bf68067f63c118f38f7539b7ba7167d577c0c8b8ce 1116 μs 775.4 μs 1.44
marlowe-semantics/57728d8b19b0e06412786f3dfed9e1894cd0ad1d2bc2bd497ec0ecb68f989d2b 434.3 μs 299.7 μs 1.45
marlowe-semantics/5abae75af26f45658beccbe48f7c88e74efdfc0b8409ba1e98f95fa5b6caf999 709.5 μs 489.2 μs 1.45
marlowe-semantics/5d0a88250f13c49c20e146819357a808911c878a0e0a7d6f7fe1d4a619e06112 1511 μs 1043 μs 1.45
marlowe-semantics/5e274e0f593511543d41570a4b03646c1d7539062b5728182e073e5760561a66 1456 μs 1006 μs 1.45
marlowe-semantics/5e2c68ac9f62580d626636679679b97109109df7ac1a8ce86d3e43dfb5e4f6bc 745.2 μs 517.5 μs 1.44
marlowe-semantics/5f130d19918807b60eab4c03119d67878fb6c6712c28c54f5a25792049294acc 440.8 μs 308.3 μs 1.43
marlowe-semantics/5f306b4b24ff2b39dab6cdc9ac6ca9bb442c1dc6f4e7e412eeb5a3ced42fb642 1089 μs 1000.9999999999999 μs 1.09
marlowe-semantics/5f3d46c57a56cef6764f96c9de9677ac6e494dd7a4e368d1c8dd9c1f7a4309a5 708 μs 491.9 μs 1.44
marlowe-semantics/64c3d5b43f005855ffc4d0950a02fd159aa1575294ea39061b81a194ebb9eaae 829.5 μs 662.5 μs 1.25
marlowe-semantics/7a758e17486d1a30462c32a5d5309bd1e98322a9dcbe277c143ed3aede9d265f 658.3 μs 514.2 μs 1.28
marlowe-semantics/7cbc5644b745f4ea635aca42cce5e4a4b9d2e61afdb3ac18128e1688c07071ba 682.2 μs 472.6 μs 1.44
marlowe-semantics/82213dfdb6a812b40446438767c61a388d2c0cfd0cbf7fd4a372b0dc59fa17e1 1864 μs 1288 μs 1.45
marlowe-semantics/8c7fdc3da6822b5112074380003524f50fb3a1ce6db4e501df1086773c6c0201 1660 μs 1156 μs 1.44
marlowe-semantics/8d9ae67656a2911ab15a8e5301c960c69aa2517055197aff6b60a87ff718d66c 518 μs 359.9 μs 1.44
marlowe-semantics/96e1a2fa3ceb9a402f2a5841a0b645f87b4e8e75beb636692478ec39f74ee221 440 μs 304.5 μs 1.44
marlowe-semantics/9fabc4fc3440cdb776b28c9bb1dd49c9a5b1605fe1490aa3f4f64a3fa8881b25 1520 μs 1045 μs 1.45
marlowe-semantics/a85173a832db3ea944fafc406dfe3fa3235254897d6d1d0e21bc380147687bd5 536.6 μs 437 μs 1.23
marlowe-semantics/a9a853b6d083551f4ed2995551af287880ef42aee239a2d9bc5314d127cce592 747 μs 513.9 μs 1.45
marlowe-semantics/acb9c83c2b78dabef8674319ad69ba54912cd9997bdf2d8b2998c6bfeef3b122 942.3 μs 655.2 μs 1.44
marlowe-semantics/acce04815e8fd51be93322888250060da173eccf3df3a605bd6bc6a456cde871 413.5 μs 283 μs 1.46
marlowe-semantics/ad6db94ed69b7161c7604568f44358e1cc11e81fea90e41afebd669e51bb60c8 849.6 μs 589.6 μs 1.44
marlowe-semantics/b21a4df3b0266ad3481a26d3e3d848aad2fcde89510b29cccce81971e38e0835 1941 μs 1356 μs 1.43
marlowe-role-payout/f7275afb60e33a550df13a132102e7e925dd28965a4efbe510a89b077ff9417f 249.9 μs 170 μs 1.47
marlowe-role-payout/fc8c5f45ffcdb024c21e0f34b22c23de8045a94d5e1a5bda1555c45ddb059f82 260 μs 177 μs 1.47
marlowe-role-payout/ff38b1ec89952d0247630f107a90cbbeb92ecbfcd19b284f60255718e4ec7548 297.1 μs 209.6 μs 1.42

This comment was automatically generated by workflow using github-action-benchmark.

CC: @IntersectMBO/plutus-core

Please sign in to comment.