-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (34 loc) · 1.15 KB
/
create-patch.yml
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
name: Create Patch
on:
push:
branches-ignore:
- master
- develop
- yuya-develop
jobs:
create-patch:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Create Patch
run: |
git config user.email "$AUTHOR_EMAIL"
git config user.name "$AUTHOR_NAME"
git rev-parse --abbrev-ref HEAD > .branch-name
git checkout yuya-develop
git checkout -b patch
git merge --squash `cat .branch-name`
git commit -m "Patch for `cat .branch-name`"
PATCH_FILE=`cat .branch-name | sed 's/\//_/g'`.patch # Replace forward slash in branch name with _
git format-patch yuya-develop..HEAD --stdout -k > $PATCH_FILE
echo "::set-output name=PATCH_FILE::$PATCH_FILE"
id: patch-creator
env:
AUTHOR_EMAIL: ${{ github.event.head_commit.author.email }}
AUTHOR_NAME: ${{ github.event.head_commit.author.name }}
- uses: actions/upload-artifact@v4
with:
name: patch
path: ${{ steps.patch-creator.outputs.PATCH_FILE }}