Skip to content

Commit

Permalink
Merge pull request #1 from DenverCoder1/fix-1
Browse files Browse the repository at this point in the history
  • Loading branch information
DenverCoder1 authored Dec 5, 2021
2 parents a09c549 + ca0aa8a commit 60bc13d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/download-button.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: "Download Button Action"

on:
release:
types:
- published
workflow_dispatch:

jobs:
Expand All @@ -24,10 +26,13 @@ jobs:
FORMAT="zip"
VERSION="${{ steps.get-latest-release.outputs.tag_name }}"
COLOR="blue"
UPDATE=$(cat README.md | perl -0777 -pe 's#(<!-- BEGIN LATEST DOWNLOAD BUTTON -->)(?:.|\n)*(<!-- END LATEST DOWNLOAD BUTTON -->)#${1}\n[![Download ${FORMAT}](https://custom-icon-badges.herokuapp.com/badge/-Download-${COLOR}?style=for-the-badge&logo=download&logoColor=white "Download ${FORMAT}")](https://github.com/${GITHUB_USER}/${REPO}/archive/${VERSION}.${FORMAT})\n${2}#g')
BEGIN_TAG="<!-- BEGIN LATEST DOWNLOAD BUTTON -->"
END_TAG="<!-- END LATEST DOWNLOAD BUTTON -->"
UPDATE=$(cat README.md | perl -0777 -pe 's#(${BEGIN_TAG})(?:.|\n)*(${END_TAG})#${1}\n[![Download ${FORMAT}](https://custom-icon-badges.herokuapp.com/badge/-Download-${COLOR}?style=for-the-badge&logo=download&logoColor=white "Download ${FORMAT}")](https://github.com/${GITHUB_USER}/${REPO}/archive/${VERSION}.${FORMAT})\n${2}#g')
echo "${UPDATE}" > README.md
- uses: EndBug/add-and-commit@v7
with:
message: 'docs: Bump version to ${{ steps.get-latest-release.outputs.tag_name }}'
message: 'docs(readme): Bump download button version to ${{ steps.get-latest-release.outputs.tag_name }}'
default_author: github_actions
branch: main

0 comments on commit 60bc13d

Please sign in to comment.