Skip to content

Commit

Permalink
feat: add badge in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
tiavina-mika committed Jun 15, 2024
1 parent 04f04b1 commit 865c7fc
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 4 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/add-badges.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# This action use https://github.com/wow-actions/add-badges?tab=readme-ov-file to add badges to your README.md file.
name: Add Badges

on:
# we are using workflow_run to trigger the workflow
# because we want to run this workflow only when the Approve PR and delete branch workflow is completed
# GitHub prevents workflows from running on events that were caused by other workflows to prevent unlimited recursion
# so we do not use the release event
# issue: https://github.com/orgs/community/discussions/25281
# see: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_run
workflow_run:
# the workflow we want to trigger this workflow (see .github/workflows/automerge.yml)
workflows: [Publish to NPM]
types: [completed]

jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: wow-actions/add-badges@v1
env:
repo_url: ${{ github.event.repository.html_url }}
repo_name: ${{ github.event.repository.name }}
repo_owner: ${{ github.event.repository.owner.login }}
with:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
badges: |
[
{
"badge": "https://img.shields.io/github/license/${{ env.repo_owner }}/${{ env.repo_name }}?style=flat-square",
"alt": "MIT License",
"link": "${{ env.repo_url }}/blob/master/LICENSE"
},
{
"badge": "https://img.shields.io/npm/v/${{ env.repo_name }}?style=flat-square",
"alt": "NPM Version",
"link": "https://www.npmjs.com/package/${{ env.repo_name }}"
},
{
"badge": "https://img.shields.io/badge/language-TypeScript-blue.svg?style=flat-square",
"alt": "Language",
"link": "https://www.typescriptlang.org"
},
{
"badge": "https://img.shields.io/github/contributors/${{ env.repo_owner }}/${{ env.repo_name }}?style=flat-square",
"alt": "Contributors",
"link": "${{ env.repo_url }}/graphs/contributors"
},
{
"badge": "https://img.shields.io/github/last-commit/${{ env.repo_owner }}/${{ env.repo_name }}?style=flat-square",
"alt": "Last Commit",
"link": "${{ env.repo_url }}/commits/master"
},
{
"badge": "https://img.shields.io/lgtm/grade/javascript/g/${{ env.repo_owner }}/${{ env.repo_name }}.svg?logo=lgtm&style=flat-square",
"alt": "Language grade: JavaScript",
"link": "https://lgtm.com/projects/g/${{ env.repo_owner }}/${{ env.repo_name }}/context:javascript"
}
]
4 changes: 3 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@ jobs:

- name: Build
run: yarn build

# npm publish
- name: Publish package on NPM 📦
# if using yarn v4
run: yarn npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- run: echo "Published to NPM 🚀- https://www.npmjs.com/package/mui-tiptap-editor"
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# mui-tiptap-editor

<p align="center">

<b>mui-tiptap-editor</b>: A customizable and easy to use <a href="https://tiptap.dev/">Tiptap</a> styled WYSIWYG rich text editor, using <a href="https://mui.com/material-ui/getting-started/overview/">Material UI</a>.

</p>


<!-- [START BADGES] -->
<!-- [END BADGES] -->
## Table of Contents

<details>
Expand Down

0 comments on commit 865c7fc

Please sign in to comment.