Skip to content

Commit cc73c77

Browse files
kfischer-okarinRedmine Patch Meetup
authored and
Redmine Patch Meetup
committed
Create patch of current branch and store it as artifact
1 parent 53da43d commit cc73c77

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

.github/workflows/create-patch.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Create Patch
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- master
7+
- development
8+
9+
jobs:
10+
create-patch:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
with:
15+
fetch-depth: 0
16+
- name: Create Patch
17+
run: |
18+
git rev-parse --abbrev-ref HEAD > .branch-name
19+
git checkout development
20+
git checkout -b patch
21+
git merge --squash `cat .branch-name`
22+
git config --global user.email "$AUTHOR_EMAIL"
23+
git config --global user.name "$AUTHOR_NAME"
24+
git commit -m "Patch for `cat .branch-name`"
25+
git format-patch development..HEAD --stdout -k > patch.diff
26+
env:
27+
AUTHOR_EMAIL: ${{ github.event.head_commit.author.email }}
28+
AUTHOR_NAME: ${{ github.event.head_commit.author.name }}
29+
- uses: actions/upload-artifact@v2
30+
with:
31+
name: patch
32+
path: patch.diff

0 commit comments

Comments
 (0)