Patch: f76878ea556f77102659ecb74ba46fe1c4a9c136_58e6331f756bb9839f1721b1b95f37bf227066cf #91
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: | |
issues: | |
types: [opened] | |
workflow_dispatch: | |
inputs: | |
startSha: | |
required: true | |
endSha: | |
required: true | |
jobs: | |
create-patch: | |
runs-on: ubuntu-latest | |
if: startsWith(github.event.issue.title, 'Patch:') | |
steps: | |
- name: Add patch label | |
uses: andymckay/labeler@5c59dabdfd4dd5bd9c6e6d255b01b9d764af4414 | |
with: | |
add-labels: 'patch' | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Add comment | |
uses: peter-evans/create-or-update-comment@a35cf36e5301d70b76f316e867e7788a55a31dae | |
with: | |
issue-number: ${{ github.event.issue.number }} | |
body: | | |
We just kicked off an action to generate the patch file for you. We will let you know here in a few minutes when your patch file is ready. | |
- uses: actions/checkout@v2 | |
- name: Checkout nopCommerce | |
run: git clone https://github.com/nopSolutions/nopCommerce | |
- name: Create Patch | |
id: patch | |
run: | | |
title="${{ github.event.issue.title }}" | |
shas=${title/Patch: /""} | |
IFS=_ read startSha endSha <<< $shas | |
git --git-dir ./nopCommerce/.git diff $startSha..$endSha --binary --relative=src > ./${startSha}_$endSha.patch | |
echo ::set-output name=file_path::"./${startSha}_$endSha.patch" | |
echo ::set-output name=startSha::"${startSha}" | |
echo ::set-output name=endSha::"${endSha}" | |
- name: Update release | |
uses: xresloader/upload-to-github-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
file: ${{ steps.patch.outputs.file_path }} | |
overwrite: true | |
update_latest_release: true | |
draft: false | |
- name: Add comment & close issue | |
uses: peter-evans/close-issue@v1 | |
with: | |
comment: | | |
We successfully generated your patch file. | |
[Please go back to the website](https://nopcommerce-patches.serret.dev/?startSha=${{ steps.patch.outputs.startSha }}&endSha=${{ steps.patch.outputs.endSha }}) and download your patch file! |