Add create patches workflow #3
Workflow file for this run
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: Create Patches | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| jobs: | |
| generate-patches: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install build dependencies | |
| run: sudo apt-get update && sudo apt-get install -y make | |
| - name: Run make create-patch | |
| run: make create-patch | |
| - name: Commit and push patch files | |
| run: | | |
| git config user.name "GitHub Actions" | |
| git config user.email "[email protected]" | |
| if [ -n "$(git status --porcelain patches/)" ]; then | |
| git add patches/ | |
| git commit -m "chore: update patches from latest commit [skip ci]" | |
| git push | |
| else | |
| echo "No changes in patches/ to commit." | |
| fi | |
| - name: Upload patch files as artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: split-patches | |
| path: patches/ |