Skip to content

Commit 8059665

Browse files
committed
Amend existing commit when updating coverage badge
1 parent d6fa471 commit 8059665

File tree

3 files changed

+22
-12
lines changed

3 files changed

+22
-12
lines changed

.github/workflows/test-coverage.yml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
with:
1616
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token.
1717
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
18+
ref: ${{ github.head_ref }}
1819

1920
- name: Setup go
2021
uses: actions/setup-go@v4
@@ -40,17 +41,18 @@ jobs:
4041
with:
4142
files: README.md
4243

43-
- name: Commit changes
44+
- name: Commit and push changes
4445
if: steps.verify-changed-files.outputs.files_changed == 'true'
4546
run: |
46-
git config --local user.email "action@github.com"
47-
git config --local user.name "GitHub Action"
47+
git config --local user.email "${{ github.event.pull_request.user.email }}"
48+
git config --local user.name "${{ github.event.pull_request.user.name }}"
4849
git add README.md
49-
git commit -m "chore: Updated coverage badge."
50-
51-
- name: Push changes
52-
if: steps.verify-changed-files.outputs.files_changed == 'true'
53-
uses: ad-m/github-push-action@master
54-
with:
55-
github_token: ${{ github.token }}
56-
branch: ${{ github.head_ref }}
50+
git commit --amend --no-edit
51+
git push origin HEAD:${{ github.head_ref }}
52+
53+
# - name: Push changes
54+
# if: steps.verify-changed-files.outputs.files_changed == 'true'
55+
# uses: ad-m/github-push-action@master
56+
# with:
57+
# github_token: ${{ github.token }}
58+
# branch: ${{ github.head_ref }}

internal/logger/debug_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ func TestDebugLogging(t *testing.T) {
1313
debug.Debug().Msg("debug message")
1414
debug.Info().Msg("info message")
1515
debug.Error().Msg("error message")
16-
debug.Warn().Msg("warning message")
16+
// debug.Warn().Msg("warning message")
1717
})
1818
}

internal/logger/logger_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,4 +128,12 @@ func TestLogger(t *testing.T) {
128128
assert.NoError(st, err)
129129
assert.Contains(st, string(output), testString)
130130
})
131+
132+
t.Run("logs", func(st *testing.T) {
133+
log := logger.New()
134+
log.Debug().Msg("debug message")
135+
log.Info().Msg("info message")
136+
log.Error().Msg("error message")
137+
log.Warn().Msg("warning message")
138+
})
131139
}

0 commit comments

Comments
 (0)