-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (42 loc) · 1.32 KB
/
check_forks.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
40
41
42
43
name: Check for new forks
on:
schedule:
# Runs at 08:00 UTC every day.
- cron: "0 8 * * *"
workflow_dispatch:
jobs:
run:
name: Run
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: "1.17.x"
- uses: actions/cache@v2
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Check for new forks
id: check
run: |
go run cmd/forks/main.go check 2> errors.txt || true
echo ::set-output name=errors::`cat errors.txt`
- name: Slack Notification
if: ${{ always() && steps.check.outputs.errors != '' }}
uses: rtCamp/action-slack-notify@12e36fc18b0689399306c2e0b3e0f2978b7f1ee7
env:
SLACK_USERNAME: GitHub Action as a Service
SLACK_COLOR: 'red'
SLACK_TITLE: 'Message'
SLACK_CHANNEL: 'checks'
SLACK_MESSAGE: ${{ steps.check.outputs.errors }}
SLACK_ICON_EMOJI: ':this-is-fine:'
SLACK_FOOTER: "Periodic forks check failed :ahhhhhhhhh:"
SLACK_WEBHOOK: ${{ secrets.SLACK_PRIV_WEBHOOK }}