Skip to content

Commit a390e3b

Browse files
authored
Merge pull request #3 from CyberLeagueAustria/create-patches-workflow
Add create patches workflow
2 parents 928b128 + 3bb838b commit a390e3b

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Create Patches
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
7+
jobs:
8+
generate-patches:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
ref: ${{ github.ref_name }}
17+
18+
- name: Install build dependencies
19+
run: sudo apt-get update && sudo apt-get install -y make
20+
21+
- name: Run make create-patch
22+
run: make create-patch
23+
24+
- name: Commit and push patch files
25+
run: |
26+
git config user.name "GitHub Actions"
27+
git config user.email "[email protected]"
28+
29+
if [ -n "$(git status --porcelain patches/)" ]; then
30+
git add patches/
31+
git commit -m "chore: update patches from latest commit [skip ci]"
32+
git push origin HEAD:${GITHUB_REF_NAME}
33+
else
34+
echo "No changes in patches/ to commit."
35+
fi
36+
env:
37+
GITHUB_REF_NAME: ${{ github.ref_name }}
38+
39+
- name: Upload patch files as artifact
40+
uses: actions/upload-artifact@v4
41+
with:
42+
name: split-patches
43+
path: patches/

0 commit comments

Comments
 (0)