You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I test-drive the pre-deploy hook in a local checkout of a public GitHub repository, then it should correctly check the build status.
$ git config --get remote.origin.url
https://github.com/basecamp/kamal.git
$ KAMAL_DESTINATION=production ruby pre-deploy.sample
Checking build status...
Build not started...
Build not started...
Build not started...
[...snip...]
Actual behavior
$ git config --get remote.origin.url
https://github.com/basecamp/kamal.git
$ KAMAL_DESTINATION=production ruby pre-deploy.sample
Checking build status...
Build status could not be found
$
# exit code is 1
The problem is that Octokit requires a different format for the GH repo in this call:
The current pre-deploy hook incorrectly passes basecamp/kamal.git instead of basecamp/kamal (no .git suffix).
A related problem is that the current pre-deploy hook only understands https://github.com/... remotes, but not [email protected]: remotes:
$ git config --get remote.origin.url
[email protected]:basecamp/kamal.git # <== see here
$ KAMAL_DESTINATION=production ruby pre-deploy.sample
Checking build status...
/Users/miguno/.local/share/mise/installs/ruby/3.4.3/lib/ruby/gems/3.4.0/gems/octokit-10.0.0/lib/octokit/repository.rb:99:in 'Octokit::Repository#raise_invalid_repository!': "[email protected]:miguno/sauber.git" is invalid as a repository identifier. Use the user/repo (String) format, or the repository ID (Integer), or a hash containing :repo and :user keys. (Octokit::InvalidRepository)
raise Octokit::InvalidRepository, msg
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
from /Users/miguno/.local/share/mise/installs/ruby/3.4.3/lib/ruby/gems/3.4.0/gems/octokit-10.0.0/lib/octokit/repository.rb:36:in 'Octokit::Repository#initialize'
from /Users/miguno/.local/share/mise/installs/ruby/3.4.3/lib/ruby/gems/3.4.0/gems/octokit-10.0.0/lib/octokit/repository.rb:59:in 'Class#new'
from /Users/miguno/.local/share/mise/installs/ruby/3.4.3/lib/ruby/gems/3.4.0/gems/octokit-10.0.0/lib/octokit/repository.rb:59:in 'Octokit::Repository.path'
from /Users/miguno/.local/share/mise/installs/ruby/3.4.3/lib/ruby/gems/3.4.0/gems/octokit-10.0.0/lib/octokit/client/statuses.rb:27:in 'Octokit::Client::Statuses#combined_status'
from pre-deploy:53:in 'GithubStatusChecks#refresh!'
from pre-deploy:49:in 'GithubStatusChecks#initialize'
from pre-deploy:89:in 'Class#new'
from pre-deploy:89:in '<main>'
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
TL;DR: The sample file for the pre-deploy hook (https://github.com/basecamp/kamal/blob/main/lib/kamal/cli/templates/sample_hooks/pre-deploy.sample) passes the wrong GitHub repo string to Octokit.
Expected behavior
When I test-drive the pre-deploy hook in a local checkout of a public GitHub repository, then it should correctly check the build status.
Actual behavior
$ git config --get remote.origin.url https://github.com/basecamp/kamal.git $ KAMAL_DESTINATION=production ruby pre-deploy.sample Checking build status... Build status could not be found $ # exit code is 1
The problem is that Octokit requires a different format for the GH repo in this call:
The current pre-deploy hook incorrectly passes
basecamp/kamal.git
instead ofbasecamp/kamal
(no.git
suffix).A related problem is that the current pre-deploy hook only understands
https://github.com/...
remotes, but not[email protected]:
remotes:The text was updated successfully, but these errors were encountered: