name: Apply Patch Files on Sideko Commits
on:
push:
branches:
- '*'
jobs:
apply-patch:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout the repository
uses: actions/checkout@v2
- name: Get the commit message
id: commit-message
run: echo "::set-output name=message::$(git log -1 --pretty=format:%s)"
- name: Apply all .patch files
if: startsWith(steps.commit-message.outputs.message, 'Sideko-commit')
run: |
for file in *.patch; do
if [ -f "$file" ]; then
git apply "$file"
fi
git add .
done
- name: Auto Commit and Push
if: startsWith(steps.commit-message.outputs.message, 'Sideko-commit')
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Apply custom patch files"
branch: ${{ github.head_ref }}
commit_options: '--no-verify'
commit_user_name: Sideko Custom Code Patcher