-
Notifications
You must be signed in to change notification settings - Fork 10
39 lines (33 loc) · 1 KB
/
slack-message.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Prow-CI
on:
schedule:
- cron: '30 3 * * *' # Runs every day at 3:30 AM UTC (9 AM IST)
workflow_dispatch:
inputs:
channel_id:
description: 'Channel ID'
required: true
slack_token:
description: 'Slack Token'
required: false
prow_url:
description: 'Prow URL'
required: true
jobs:
build:
runs-on: ubuntu-latest
container:
image: golang:1.20
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Setup Go environment
uses: actions/setup-go@v4
- name: Run Test and Store Output
run: go run main.go prowjob periodic-report > prowjob-output.txt
- name: Send Slack Message
run: go run main.go send-slack-message -m "$(cat prowjob-output.txt)"
env:
SLACK_TOKEN: ${{ inputs.slack_token || secrets.SLACK_TOKEN }}
PROW_URL: ${{ inputs.prow_url || secrets.PROW_URL }}
CHANNEL_ID: ${{ inputs.channel_id || secrets.CHANNEL_ID }}