Skip to content

Commit

Permalink
docs: run badge only if default branch
Browse files Browse the repository at this point in the history
  • Loading branch information
fritx committed Jun 7, 2023
1 parent ebbdc1c commit ca8d791
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,7 @@ jobs:
# Add this
- name: Update Coverage Badge
# GitHub actions: default branch variable
# https://stackoverflow.com/questions/64781462/github-actions-default-branch-variable
if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
uses: ./
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,14 @@
1. Make sure you have gh-pages branch and have GitHub Pages on:

```sh
# if you don't have gh-pages yet
# if you don't have gh-pages yet, create a clean branch
git stash
git switch --orphan gh-pages
git commit --allow-empty -m "Initial commit"
git push -u origin gh-pages

git checkout main
git stash apply
```

See Step.6 in [🚀 Blog Setup via Github Fork](https://fritx.github.io/silent/?2022/09/blog-setup-via-github-fork)
Expand Down Expand Up @@ -60,6 +64,9 @@

# Add this
- name: Update Coverage Badge
# GitHub actions: default branch variable
# https://stackoverflow.com/questions/64781462/github-actions-default-branch-variable
if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
uses: we-cli/coverage-badge-action@main
```

Expand Down

0 comments on commit ca8d791

Please sign in to comment.