From 5121f366bf5e75351090b22cc1a445eea9ca17eb Mon Sep 17 00:00:00 2001 From: Enrico Minack Date: Mon, 23 May 2022 18:33:12 +0200 Subject: [PATCH] Fix badge creation to really upload only master --- .github/workflows/test-results.yml | 4 +++- README.md | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-results.yml b/.github/workflows/test-results.yml index 4ec420ae..de8c40c2 100644 --- a/.github/workflows/test-results.yml +++ b/.github/workflows/test-results.yml @@ -69,7 +69,9 @@ jobs: - name: Upload badge to Gist # Upload only for master branch - if: github.ref == 'refs/heads/master' + if: > + github.event_name == 'workflow_run' && github.event.workflow_run.head_branch == 'master' || + github.event_name != 'workflow_run' && github.ref == 'refs/heads/master' uses: andymckay/append-gist-action@1fbfbbce708a39bd45846f0955ed5521f2099c6d with: token: ${{ secrets.GIST_TOKEN }} diff --git a/README.md b/README.md index 90cbf0d4..bf35cb4b 100644 --- a/README.md +++ b/README.md @@ -516,7 +516,9 @@ steps: - name: Upload badge to Gist # Upload only for master branch - if: github.ref == 'refs/heads/master' + if: > + github.event_name == 'workflow_run' && github.event.workflow_run.head_branch == 'master' || + github.event_name != 'workflow_run' && github.ref == 'refs/heads/master' uses: andymckay/append-gist-action@1fbfbbce708a39bd45846f0955ed5521f2099c6d with: token: ${{ secrets.GIST_TOKEN }}