From 555f5a39798d337fda3bff119b0b9a1a6d1533ef Mon Sep 17 00:00:00 2001 From: Subho Date: Sun, 28 Jul 2024 17:59:20 +0530 Subject: [PATCH] Fix more issues - use | for executing script one after the other - use `#` as a delimiter in sed instead of `/`, because `/` are also part of links - set name & email, necessary for committing --- .github/workflows/update-download-link.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/update-download-link.yml b/.github/workflows/update-download-link.yml index c314b34..9d41ec9 100644 --- a/.github/workflows/update-download-link.yml +++ b/.github/workflows/update-download-link.yml @@ -9,14 +9,17 @@ jobs: - name: Checkout uses: actions/checkout@v4 - name: Update - run: + run: | version=$(git describe --tags --abbrev=0) new_link="https://github.com/subhoghoshX/Samay/releases/download/$version/samay-$version.zip" - sed -i "s/\[zip file\](.*)/\[zip file\]\($new_link\)/g" README.md + sed -i "s#\[zip file\](.*)#\[zip file\]\($new_link\)#g" README.md - # Sent PR - - run: git add . - - run: git commit -m "Update download link" - - run: gh pr create -B "update-link-for-$version" -H main --title 'Update download link' --body 'Created by Github action' + - name: Send PR + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + git add . + git commit -m "Update download link" + gh pr create -B "update-link-for-$version" -H main --title 'Update download link' --body 'Created by Github action' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}