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 fe7fb65
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 12 deletions.
24 changes: 13 additions & 11 deletions .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 All @@ -40,17 +41,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 config --local user.email "${{ github.event.pusher.email }}"
git config --local user.name "${{ github.event.pusher.name }}"
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 origin HEAD:${{ github.head_ref }}
# - 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 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 fe7fb65

Please sign in to comment.