Skip to content

Commit

Permalink
Amend existing commit when updating coverage badge
Browse files Browse the repository at this point in the history
  • Loading branch information
robgonnella committed Dec 12, 2023
1 parent d6fa471 commit aeda4c6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/test-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token.
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
ref: ${{ github.head_ref }}

- name: Setup go
uses: actions/setup-go@v4
Expand Down Expand Up @@ -46,11 +47,12 @@ jobs:
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add README.md
git commit -m "chore: Updated coverage badge."
git commit --amend --no-edit
- name: Push changes
if: steps.verify-changed-files.outputs.files_changed == 'true'
uses: ad-m/github-push-action@master
with:
github_token: ${{ github.token }}
branch: ${{ github.head_ref }}
force: true
2 changes: 1 addition & 1 deletion internal/logger/debug_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ func TestDebugLogging(t *testing.T) {
debug.Debug().Msg("debug message")
debug.Info().Msg("info message")
debug.Error().Msg("error message")
debug.Warn().Msg("warning message")
// debug.Warn().Msg("warning message")
})
}
8 changes: 8 additions & 0 deletions internal/logger/logger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,12 @@ func TestLogger(t *testing.T) {
assert.NoError(st, err)
assert.Contains(st, string(output), testString)
})

t.Run("logs", func(st *testing.T) {
log := logger.New()
log.Debug().Msg("debug message")
log.Info().Msg("info message")
log.Error().Msg("error message")
log.Warn().Msg("warning message")
})
}

0 comments on commit aeda4c6

Please sign in to comment.