forked from rusefi/rusefi
-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (46 loc) · 1.69 KB
/
Copy pathupdate-wideband-reference.yaml
File metadata and controls
55 lines (46 loc) · 1.69 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
# todo: reduce copy-paste with update-libfirmware-reference.yaml
name: Update wideband Reference
on:
workflow_dispatch:
schedule:
- cron: '45 0 * * *'
jobs:
update-git:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Git Checkout Submodules
run: |
git submodule update --init firmware/controllers/can/wideband_firmware
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- name: Git Update Submodules
run: |
git submodule update --remote
- name: Commit fresh 'firmware/controllers/can/wideband_firmware' submodule
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub wideband_firmware update Action"
git add firmware/controllers/can/wideband_firmware
OUT=$(git commit -am "GHA says update wideband_firmware submodule" 2>&1) || echo "commit failed, finding out why"
if echo "$OUT" | grep 'nothing to commit'; then
echo "submodule: looks like nothing to commit"
echo "NOCOMMIT=true" >> $GITHUB_ENV
exit 0
elif echo "$OUT" | grep 'changed'; then
echo "submodule: looks like something has changed"
else
echo "submodule: looks like something unexpected"
exit 1
fi
git status
- name: Push
if: ${{ env.NOCOMMIT != 'true'}}
uses: ad-m/github-push-action@master
with:
github_token: ${{ github.token }}
branch: ${{ github.ref }}