-
Notifications
You must be signed in to change notification settings - Fork 147
58 lines (46 loc) · 1.33 KB
/
ValidatePR.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
46
47
48
49
50
51
52
53
54
55
56
57
58
---
name: Validate PR
on:
pull_request:
paths:
- 'participants/**/*.yml'
jobs:
ValidateYAML:
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v3
- name: Validate YAML files
uses: SoftCreatR/[email protected]
ValidateLinks:
runs-on: ubuntu-latest
needs: [ValidateYAML]
steps:
- name: Git checkout
uses: actions/checkout@v3
- name: Set up Ruby 2.6
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
- id: file-diff
uses: lots0logs/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Validate Links
run: |
FILELIST=""
for FILENAME in $(jq '.[]' $HOME/files.json); do
FILENAME="${FILENAME:1}"
FILENAME="${FILENAME::-1}"
if [ -f "$FILENAME" ] && [[ $FILENAME == *"participants"* ]] && [ "${FILENAME: -4}" == ".yml" ]; then
FILELIST+="$FILENAME,"
else
echo "- Skipped $FILENAME"
fi
done
if [ -n "$FILELIST" ]; then
gem install awesome_bot
awesome_bot --files "$FILELIST" --allow-dupe --allow-redirect --skip-save-results
else
echo "Nothing to do."
fi