-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: updated README and github actions for download
- Loading branch information
1 parent
8984263
commit 293851f
Showing
2 changed files
with
45 additions
and
3 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: "Download Button Action" | ||
|
||
on: | ||
release: | ||
types: | ||
- published | ||
workflow_dispatch: | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Get latest release | ||
id: get-latest-release | ||
uses: InsonusK/[email protected] | ||
with: | ||
myToken: ${{ github.token }} | ||
view_top: 1 | ||
|
||
- name: Readme Download Button Action | ||
env: | ||
GITHUB_USER: "codeskills-dev" | ||
REPO: "30-days-of-html" | ||
FORMAT: "zip" | ||
VERSION: "${{ steps.get-latest-release.outputs.tag_name }}" | ||
COLOR: "blue" | ||
BEGIN_TAG: "<!-- BEGIN LATEST DOWNLOAD BUTTON -->" | ||
END_TAG: "<!-- END LATEST DOWNLOAD BUTTON -->" | ||
run: | | ||
UPDATE=$(cat README.md | perl -0777 -pe 's#(${{ env.BEGIN_TAG }})(?:.|\n)*?(${{ env.END_TAG }})#${1}\n[![Download ${{ env.FORMAT }}](https://custom-icon-badges.herokuapp.com/badge/-Download-${{ env.COLOR }}?style=for-the-badge&logo=download&logoColor=white "Download ${{ env.FORMAT }}")](https://github.com/${{ env.GITHUB_USER }}/${{ env.REPO }}/archive/${{ env.VERSION }}.${{ env.FORMAT }})\n${2}#g') | ||
echo "${UPDATE}" > README.md | ||
- uses: EndBug/add-and-commit@v7 | ||
with: | ||
message: "docs(readme): Bump download button version to ${{ steps.get-latest-release.outputs.tag_name }}" | ||
default_author: github_actions | ||
branch: main |
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