ci: clean up downloaded event-codes header after generation #4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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: Create Pull Request | |
| uses: peter-evans/create-pull-request@v8 | |
| with: | |
| commit-message: "chore: auto-regenerate ecodes files" | |
| title: "chore: auto-regenerate ecodes files" | |
| body: "Auto-generated changes by the `generate-ecodes` workflow." | |
| branch: "auto-generate-ecodes" |