-
-
Notifications
You must be signed in to change notification settings - Fork 1
61 lines (53 loc) · 1.7 KB
/
update.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
name: update (hourly)
on:
workflow_dispatch:
inputs:
force:
description: Force update regardless of "bun run check"
default: false
required: false
type: boolean
schedule:
- cron: "30 * * * *"
jobs:
check-update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: main
path: main
- uses: actions/checkout@v4
with:
ref: data
path: data
- uses: actions/setup-python@v5
with:
python-version: "3.12.4"
- uses: oven-sh/setup-bun@v1
- working-directory: main
run: bun install
- name: Check for version
id: versioner
working-directory: main
run: |
version=$(bun run check ${{ github.event.inputs.force && '--force' || '' }})
echo "[DEBUG]: Check result: $version"
echo "version=$version" >> $GITHUB_OUTPUT
- name: Update
if: ${{ steps.versioner.outputs.version != 'false' }}
env:
code_webhook: ${{ secrets.CODE_WEBHOOK }}
color_webhook: ${{ secrets.COLOR_WEBHOOK }}
icons_webhook: ${{ secrets.ICONS_WEBHOOK }}
working-directory: main
run: bun run update
- name: Publish changes
if: ${{ steps.versioner.outputs.version != 'false' }}
working-directory: data
run: |
git config user.name github-actions
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
git add .
git commit -m "chore: update for version ${{ steps.versioner.outputs.version }}" || true
git push