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 578289c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 11 deletions.
19 changes: 10 additions & 9 deletions .github/workflows/test-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 "[email protected]"
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 }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
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 578289c

Please sign in to comment.