From 578289c4d96fc6247a7467b883843ffff13f90cd Mon Sep 17 00:00:00 2001 From: Rob Gonnella Date: Tue, 12 Dec 2023 09:41:39 -0500 Subject: [PATCH] Amend existing commit when updating coverage badge --- .github/workflows/test-coverage.yml | 19 ++++++++++--------- README.md | 2 +- internal/logger/debug_test.go | 2 +- internal/logger/logger_test.go | 8 ++++++++ 4 files changed, 20 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test-coverage.yml b/.github/workflows/test-coverage.yml index e1b5196..94a23a2 100644 --- a/.github/workflows/test-coverage.yml +++ b/.github/workflows/test-coverage.yml @@ -40,17 +40,18 @@ jobs: with: files: README.md - - name: Commit changes + - name: Commit and push changes if: steps.verify-changed-files.outputs.files_changed == 'true' run: | git config --local user.email "action@github.com" git config --local user.name "GitHub Action" git add README.md - git commit -m "chore: Updated coverage badge." - - - 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 }} + git commit --amend --no-edit + git push -f + + # - 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 }} diff --git a/README.md b/README.md index fbbc18f..31dc48c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # go-lanscan -![Coverage](https://img.shields.io/badge/Coverage-91.2%25-brightgreen) +![Coverage](https://img.shields.io/badge/Coverage-91.1%25-brightgreen) A network cli and golang package that allows you to perform arp and syn scanning on a local area network. diff --git a/internal/logger/debug_test.go b/internal/logger/debug_test.go index 107d26b..07bb93b 100644 --- a/internal/logger/debug_test.go +++ b/internal/logger/debug_test.go @@ -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") }) } diff --git a/internal/logger/logger_test.go b/internal/logger/logger_test.go index 027d273..ec7f27a 100644 --- a/internal/logger/logger_test.go +++ b/internal/logger/logger_test.go @@ -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") + }) }