-
Notifications
You must be signed in to change notification settings - Fork 4
117 lines (101 loc) · 3.44 KB
/
main.yml
File metadata and controls
117 lines (101 loc) · 3.44 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: Update .luacheckrc
on:
push:
branches:
- 'main'
paths:
- '.luacheckrc_header'
- '.github/workflows/main.yml'
schedule:
- cron: '30 5,17 * * *'
workflow_dispatch:
permissions: read-all
jobs:
generate:
name: generate new .luacheckrc
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
fetch-depth: 5
token: ${{ secrets.BMOS_SYNC_TOKEN }}
- name: Sync Rulesets
env:
GH_TOKEN: ${{ secrets.BMOS_SYNC_TOKEN }}
run: |
RULESETS=(
"FG-Unofficial-Developers-Guild/CoreRPG|CoreRPG"
"FG-Unofficial-Developers-Guild/2E|DND2E"
"FG-Unofficial-Developers-Guild/3.5E|DND35E"
"FG-Unofficial-Developers-Guild/4e|DND4E"
"FG-Unofficial-Developers-Guild/5e|DND5E"
"FG-Unofficial-Developers-Guild/PFRPG|PFRPG"
"FG-Unofficial-Developers-Guild/PFRPG2|PFRPG2"
"FG-Unofficial-Developers-Guild/SFRPG|SFRPG"
)
for item in "${RULESETS[@]}"; do
IFS="|" read -r repo folder <<< "$item"
gh repo clone "$repo" ".fg/rulesets/$folder" -- --depth 1 &
done
wait
- env:
GH_TOKEN: ${{ secrets.BMOS_SYNC_TOKEN }}
run: |
# Add external repos
EXT_LIST=(
"Kelrugem/Extended-automation-and-overlays"
"rhagelstrom/BetterCombatEffects"
"MeAndUnique/SizeMatters"
"MeAndUnique/TemporalFixation"
"SirMotte/FGU-Theme-Hearth"
"rhagelstrom/Turbo"
"rhagelstrom/Contaminated"
"rhagelstrom/FranklyNot"
"rhagelstrom/PowerUp"
"rhagelstrom/Exhausted"
"rhagelstrom/ChatAestheticsConfigurator"
"rhagelstrom/ArcaneWard"
"rhagelstrom/EffectiveInitiative"
"rhagelstrom/HighVariance"
"rhagelstrom/Effective-NPC"
"rhagelstrom/LifeLedger"
"rhagelstrom/Pets"
)
# Add Guild repos starting with `FG-`, excluding archived ones
JQ_FILTER='.[] | select(.isArchived == false and (.name | startswith("FG-"))).nameWithOwner'
GUILD_REPOS=$(gh repo list FG-Unofficial-Developers-Guild \
--limit 200 \
--json nameWithOwner,name,isArchived \
--jq "$JQ_FILTER")
# Merge and clone
declare -A CLONE_MAP
for repo in "${EXT_LIST[@]}"; do
folder="${repo##*/}"
CLONE_MAP["$folder"]="$repo"
done
for repo in $GUILD_REPOS; do
folder="${repo##*/}"
if [[ -z "${CLONE_MAP[$folder]}" ]]; then
CLONE_MAP["$folder"]="$repo"
fi
done
# Parallel Clone
for folder in "${!CLONE_MAP[@]}"; do
repo="${CLONE_MAP[$folder]}"
echo "Cloning $repo -> .fg/extensions/$folder"
gh repo clone "$repo" ".fg/extensions/$folder" -- --depth 1 &
done
wait
- uses: FG-Unofficial-Developers-Guild/action-generate-luacheckrc@main
with:
std: '+dnd2e+dnd35e+dnd4e+dnd5e+pfrpg+pfrpg2+sfrpg'
- uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0
with:
token: ${{ secrets.BMOS_SYNC_TOKEN }}
branch: update-luacheckrc
title: Update .luacheckrc
commit-message: "The latest .luacheckrc config built from targeted repos."
delete-branch: true