-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
04f04b1
commit 865c7fc
Showing
3 changed files
with
64 additions
and
4 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,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" | ||
} | ||
] |
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
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