set-output 廃止に伴う修正 (#10) #36
This file contains 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 Patch | |
on: | |
push: | |
branches-ignore: | |
- master | |
- develop | |
jobs: | |
create-patch: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
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 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 develop..HEAD --stdout -k > $PATCH_FILE | |
echo "PATCH_FILE=$PATCH_FILE" >> $GITHUB_OUTPUT | |
id: patch-creator | |
env: | |
AUTHOR_EMAIL: ${{ github.event.head_commit.author.email }} | |
AUTHOR_NAME: ${{ github.event.head_commit.author.name }} | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: patch | |
path: ${{ steps.patch-creator.outputs.PATCH_FILE }} |