-
Notifications
You must be signed in to change notification settings - Fork 37
62 lines (53 loc) · 1.79 KB
/
push.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
59
60
61
62
name: Send message to proper discord channel when a PR is merged.
on:
push:
branches:
- udc
- vic
- udc-vanilla
- vic-vanilla
pull_request:
types:
- closed
jobs:
process-json-files:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Get changed files in the builds folder
id: changed-files-specific
uses: tj-actions/changed-files@v45
with:
files: |
builds/*.json
changelogs/*.txt
- name: Process JSON files if files changed in builds folder.
if: steps.changed-files-specific.outputs.any_changed == 'true'
env:
VIC_WEBHOOK: ${{ secrets.VIC_WEBHOOK }}
UDC_WEBHOOK: ${{ secrets.UDC_WEBHOOK }}
VIC_VANILLA_WEBHOOK: ${{ secrets.VIC_VANILLA_WEBHOOK }}
UDC_VANILLA_WEBHOOK: ${{ secrets.UDC_VANILLA_WEBHOOK }}
ALL_CHANGED_FILES: ${{ steps.changed-files-specific.outputs.all_changed_files }}
run: |
echo "Checking if JSON and TXT files are matching..."
json_list=()
for json in $ALL_CHANGED_FILES; do
if [[ "$json" == *.json ]]; then
json_basename=$(basename "$json")
txt_file="${json_basename%.json}.txt"
for txt in $ALL_CHANGED_FILES; do
txt_basename=$(basename "$txt")
if [[ "$txt_basename" == "$txt_file" ]]; then
echo "Found matching TXT file for $json_basename"
json_list+=("$json")
break
fi
done
fi
done
for json in "${json_list[@]}"; do
echo "Processing file: $json"
python3 .github/push.py "$json"
done