Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error when there is only 1 commit #82

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lucapino-kobalt
Copy link

WHAT

Fix by 1 error in extracting previous commit

WHY

When the repository contains only 1 commit, the extraction of the previous commit fails:

panic: runtime error: index out of range [1] with length 1

goroutine 1 [running]:
github.com/mercari/tfnotify/notifier/github.(*CommitsService).lastOne(...)
	/home/runner/work/tfnotify/tfnotify/notifier/github/commits.go:48
github.com/mercari/tfnotify/notifier/github.(*NotifyService).Notify(0xc000102ad0, 0xc00018e480, 0x441, 0xc00000e018, 0xc000190000, 0x32e)
	/home/runner/work/tfnotify/tfnotify/notifier/github/notify.go:94 +0x875
main.(*tfnotify).Run(0xc000147380, 0xc000172d90, 0x8)
	/home/runner/work/tfnotify/tfnotify/main.go:188 +0x5e2
main.cmdApply(0xc000102840, 0x0, 0xc0000109a0)
	/home/runner/work/tfnotify/tfnotify/main.go:320 +0x1e8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant