Skip to content

Commit

Permalink
fix: nodejs readme badges (#1985)
Browse files Browse the repository at this point in the history
badges should only update on runs from main branch
  • Loading branch information
SgtPooki authored Jul 24, 2022
1 parent 136b260 commit a9e661b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/node-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: "Reset ${{ inputs.gh-node-version }} badge"
if: github.ref == 'refs/heads/main'
uses: RubbaBoy/BYOB@24f464284c1fd32028524b59607d417a2e36fee7
with:
ICON: https://raw.githubusercontent.com/devicons/devicon/master/icons/nodejs/nodejs-original.svg
Expand Down Expand Up @@ -78,7 +79,7 @@ jobs:
if: always()
steps:
- name: Create success badge
if: ${{ needs.test-node.result == 'success' }}
if: ${{ needs.test-node.result == 'success' && github.ref == 'refs/heads/main' }}
uses: RubbaBoy/BYOB@24f464284c1fd32028524b59607d417a2e36fee7
with:
ICON: https://raw.githubusercontent.com/devicons/devicon/master/icons/nodejs/nodejs-original.svg
Expand All @@ -89,7 +90,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create failure badge
if: ${{ needs.test-node.result != 'success' }}
if: ${{ needs.test-node.result != 'success' && github.ref == 'refs/heads/main' }}
uses: RubbaBoy/BYOB@24f464284c1fd32028524b59607d417a2e36fee7
with:
ICON: https://raw.githubusercontent.com/devicons/devicon/master/icons/nodejs/nodejs-original.svg
Expand Down

0 comments on commit a9e661b

Please sign in to comment.