-
Notifications
You must be signed in to change notification settings - Fork 13
45 lines (43 loc) · 1.11 KB
/
vet.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
44
45
name: Vet
on:
pull_request:
branches:
- master
jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: schema validate
uses: nrkno/yaml-schema-validator-github-action@v4
with:
schema: schema.yaml
target: config.yaml
duplicates:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: mikefarah/yq@v4.30.8
- name: duplicate repository tag check
run: |
OUTPUT=$(yq 'group_by(.target.repository + ":" + .target.tag) | map(select(length>1))' config.yaml)
if [ "$OUTPUT" != "[]" ]; then
echo "Duplicate tag found in config.yaml"
echo $OUTPUT
exit 1
fi
notify:
name: Discord Notification
runs-on: ubuntu-latest
needs:
- validate
- duplicates
if: failure()
steps:
- name: Notify
uses: nobrayner/discord-webhook@v1
with:
github-token: ${{ secrets.github_token }}
discord-webhook: ${{ secrets.DISCORD_WEBHOOK }}