talos

Форк
0
/
slack-notify.yaml 
117 строк · 5.1 Кб
1
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
2
#
3
# Generated on 2024-06-11T15:17:44Z by kres 7360563.
4

5
name: slack-notify
6
"on":
7
  workflow_run:
8
    workflows:
9
      - default
10
      - integration-qemu-cron
11
      - integration-conformance-cron
12
      - integration-trusted-boot-cron
13
      - integration-provision-0-cron
14
      - integration-provision-1-cron
15
      - integration-provision-2-cron
16
      - integration-misc-0-cron
17
      - integration-misc-1-cron
18
      - integration-misc-2-cron
19
      - integration-misc-3-cron
20
      - integration-misc-4-cron
21
      - integration-extensions-cron
22
      - integration-cilium-cron
23
      - integration-qemu-encrypted-vip-cron
24
      - integration-qemu-race-cron
25
      - integration-qemu-csi-cron
26
      - integration-images-cron
27
      - integration-reproducibility-test-cron
28
      - integration-cloud-images-cron
29
      - integration-image-factory-cron
30
      - integration-aws-cron
31
      - integration-aws-nvidia-oss-cron
32
      - integration-aws-nvidia-nonfree-cron
33
      - integration-azure-cron
34
      - integration-equinix-metal-cron
35
    types:
36
      - completed
37
jobs:
38
  slack-notify:
39
    runs-on:
40
      - self-hosted
41
      - generic
42
    if: github.event.workflow_run.conclusion != 'skipped'
43
    steps:
44
      - name: Get PR number
45
        id: get-pr-number
46
        if: github.event.workflow_run.event == 'pull_request'
47
        env:
48
          GH_TOKEN: ${{ github.token }}
49
        run: |
50
          echo pull_request_number=$(gh pr view -R ${{ github.repository }} ${{ github.event.workflow_run.head_repository.owner.login }}:${{ github.event.workflow_run.head_branch }} --json number --jq .number) >> $GITHUB_OUTPUT
51
      - name: Slack Notify
52
        uses: slackapi/slack-github-action@v1
53
        with:
54
          channel-id: proj-talos-maintainers
55
          payload: |
56
            {
57
                "attachments": [
58
                    {
59
                        "color": "${{ github.event.workflow_run.conclusion == 'success' && '#2EB886' || github.event.workflow_run.conclusion == 'failure' && '#A30002' || '#FFCC00' }}",
60
                        "fallback": "test",
61
                        "blocks": [
62
                            {
63
                                "type": "section",
64
                                "fields": [
65
                                    {
66
                                        "type": "mrkdwn",
67
                                        "text": "${{ github.event.workflow_run.event == 'pull_request' && format('*Pull Request:* {0} (`{1}`)\n<{2}/pull/{3}|{4}>', github.repository, github.ref_name, github.event.repository.html_url, steps.get-pr-number.outputs.pull_request_number, github.event.workflow_run.display_title) || format('*Build:* {0} (`{1}`)\n<{2}/commit/{3}|{4}>', github.repository, github.ref_name, github.event.repository.html_url, github.sha, github.event.workflow_run.display_title) }}"
68
                                    },
69
                                    {
70
                                        "type": "mrkdwn",
71
                                        "text": "*Status:*\n`${{ github.event.workflow_run.conclusion }}`"
72
                                    }
73
                                ]
74
                            },
75
                            {
76
                                "type": "section",
77
                                "fields": [
78
                                    {
79
                                        "type": "mrkdwn",
80
                                        "text": "*Author:*\n`${{ github.actor }}`"
81
                                    },
82
                                    {
83
                                        "type": "mrkdwn",
84
                                        "text": "*Event:*\n`${{ github.event.workflow_run.event }}`"
85
                                    }
86
                                ]
87
                            },
88
                            {
89
                                "type": "divider"
90
                            },
91
                            {
92
                                "type": "actions",
93
                                "elements": [
94
                                    {
95
                                        "type": "button",
96
                                        "text": {
97
                                            "type": "plain_text",
98
                                            "text": "Logs"
99
                                        },
100
                                        "url": "${{ github.event.workflow_run.html_url }}"
101
                                    },
102
                                    {
103
                                        "type": "button",
104
                                        "text": {
105
                                            "type": "plain_text",
106
                                            "text": "Commit"
107
                                        },
108
                                        "url": "${{ github.event.repository.html_url }}/commit/${{ github.sha }}"
109
                                    }
110
                                ]
111
                            }
112
                        ]
113
                    }
114
                ]
115
            }
116
        env:
117
          SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
118

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.