-
Notifications
You must be signed in to change notification settings - Fork 48
37 lines (28 loc) · 1.06 KB
/
mdrdownload.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
name: Download Firmware
on:
workflow_dispatch:
schedule:
- cron: '0 8 * * *'
jobs:
download:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Caching npm dependencies
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm install
- name: Build
run: npm run build
- name: Download
run: npm run download
- name: Commit files
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add firmware/* mdrdownload.json
updated_service_ids=`git status -s | grep "^A " | awk '{print $2}' | xargs -i sh -c 'basename $(dirname $(dirname {}))' | grep -v "\." | sort -u | sed -z 's/\n/, /g' | sed 's/, $//'`
git diff-index --cached --quiet HEAD -- || (git commit -m "Auto download firmware (${updated_service_ids})" && git push)