-
-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (45 loc) · 1.56 KB
/
Copy pathgenerate-ecodes.yml
File metadata and controls
55 lines (45 loc) · 1.56 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
name: Generate Ecodes
on:
push:
branches: [main]
paths:
- "scripts/generate-ecodes.lua"
- ".github/workflows/generate-ecodes.yml"
# Weekly run every Sunday at 00:00 UTC
schedule:
- cron: "0 0 * * 0"
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
generate:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Install Lua
uses: leafo/gh-actions-lua@v13
with:
luaVersion: "luajit"
- name: Download latest input-event-codes.h
run: curl -sSfL https://raw.githubusercontent.com/torvalds/linux/master/include/uapi/linux/input-event-codes.h -o input-event-codes.h
- name: Run code generation script
run: ./scripts/generate-ecodes.lua input-event-codes.h
- name: Clean up temporary header
run: rm input-event-codes.h
- name: Determine PR type
id: pr-type
run: |
if git diff --quiet HEAD src/evdev/ecodes.lua; then
echo "title=chore(ecodes): auto-regenerate ecodes files" >> $GITHUB_OUTPUT
else
echo "title=feat(ecodes): update event codes to latest Linux kernel" >> $GITHUB_OUTPUT
fi
- name: Create Pull Request
uses: peter-evans/create-pull-request@v8
with:
commit-message: "${{ steps.pr-type.outputs.title }}"
title: "${{ steps.pr-type.outputs.title }}"
body: "Auto-generated changes by the `generate-ecodes` workflow."
branch: "auto-generate-ecodes"