Update Download Link #15
Workflow file for this run
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: Update Download Link | |
on: | |
release: | |
types: [published] | |
jobs: | |
update-downlad-link: | |
permissions: | |
contents: write | |
pull-requests: write | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Update | |
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 | |
# Send PR | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git checkout -b "update-link-for-$version" | |
git add . | |
git commit -m "Update download link" | |
git push origin "update-link-for-$version" | |
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 }} |