From 61f19df2b3e38a8096105b874de1683c820d876c Mon Sep 17 00:00:00 2001 From: Russell Dempsey <1173416+SgtPooki@users.noreply.github.com> Date: Thu, 21 Jul 2022 08:35:40 -0700 Subject: [PATCH] fix: nodejs readme badges badges should only update on runs from main branch --- .github/workflows/node-test.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/node-test.yml b/.github/workflows/node-test.yml index cf0627afa..08db99967 100644 --- a/.github/workflows/node-test.yml +++ b/.github/workflows/node-test.yml @@ -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 @@ -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 @@ -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