Skip to content

Instantly share code, notes, and snippets.

@dotemacs
Last active October 24, 2017 09:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dotemacs/2c34fd558ae9fd86123e3287fab7893b to your computer and use it in GitHub Desktop.
Save dotemacs/2c34fd558ae9fd86123e3287fab7893b to your computer and use it in GitHub Desktop.
Open branch in Semaphore CI
(defun semaphore-open-branch ()
"Open branch in Semaphore CI"
(interactive)
(let* ((branch (magit-get-current-branch))
(group-repo (replace-regexp-in-string "mobytronics" "mobytrader"
(thread-first (magit-get "remote" "origin" "url")
(split-string ":")
last
first
(split-string "\\.")
first))))
(browse-url (format "https://semaphoreci.com/%s/branches/%s" group-repo branch))))
;; add the below to your magit config
(add-hook 'magit-mode-hook
(lambda ()
(local-set-key (kbd "j") 'semaphore-open-branch)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment