Skip to content

Patch: 7928e23b58bd8c2508a9480afd66f5738baf2ddd_0334c75cca25e3e5cff2812f3c4c59ad4a74a0fb #89

Patch: 7928e23b58bd8c2508a9480afd66f5738baf2ddd_0334c75cca25e3e5cff2812f3c4c59ad4a74a0fb

Patch: 7928e23b58bd8c2508a9480afd66f5738baf2ddd_0334c75cca25e3e5cff2812f3c4c59ad4a74a0fb #89

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!