Repository navigation
65 lines (53 loc) · 1.79 KB
/
Copy pathupdate-protocol.yml
File metadata and controls
65 lines (53 loc) · 1.79 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
name: Update Mouse Protocol
on:
schedule:
# Avoid the top of the hour, when scheduled workflows are most likely to queue.
- cron: "17 * * * *"
workflow_dispatch:
permissions:
contents: write
concurrency:
group: update-mouse-protocol
cancel-in-progress: true
jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: 24
cache: npm
- name: Install latest protocol release
id: protocol
shell: bash
run: |
set -euo pipefail
current=$(node -p "require('./package.json').dependencies['@openmouse/protocol']")
latest=$(npm view @openmouse/protocol version)
if [[ "$current" == "$latest" ]]; then
echo "changed=false" >> "$GITHUB_OUTPUT"
exit 0
fi
npm install --save-exact "@openmouse/protocol@$latest"
git diff --exit-code -- . \
':(exclude)package.json' \
':(exclude)package-lock.json'
echo "changed=true" >> "$GITHUB_OUTPUT"
echo "version=$latest" >> "$GITHUB_OUTPUT"
- name: Validate control panel
if: steps.protocol.outputs.changed == 'true'
run: |
npm run check
npm run size
npm audit --audit-level=high
- name: Commit verified update
if: steps.protocol.outputs.changed == 'true'
env:
VERSION: ${{ steps.protocol.outputs.version }}
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add package.json package-lock.json
git commit -m "chore(protocol): bump @openmouse/protocol to $VERSION"
git push