feat(gs/emacs): Link created PR to clocked in item
After creating a pull request link it to the currently clocked in org-mode headline if any. Change-Id: I75d7e70316494e355e11864496fdfc8b9e3009e1 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1979 Reviewed-by: glittershark <grfn@gws.fyi> Tested-by: BuildkiteCI
This commit is contained in:
parent
eb11cced9d
commit
94c7990d57
1 changed files with 16 additions and 0 deletions
|
@ -144,3 +144,19 @@
|
|||
|
||||
;;; TODO: this doesn't work?
|
||||
(define-auto-insert "\\.org?$" #'grfn/insert-org-template t)
|
||||
|
||||
(defun forge--post-submit-around---link-pr-to-org-item
|
||||
(orig)
|
||||
(let ((cb (funcall orig)))
|
||||
(lambda (value headers status req)
|
||||
(prog1 (funcall cb value headers status req)
|
||||
(grfn/at-org-clocked-in-item
|
||||
(let ((url (alist-get 'url value))
|
||||
(number (alist-get 'number value)))
|
||||
(org-set-property
|
||||
"pull-request"
|
||||
(org-make-link-string url (number-to-string number)))))))))
|
||||
|
||||
(advice-add
|
||||
#'forge--post-submit-callback
|
||||
:around #'forge--post-submit-around---link-pr-to-org-item)
|
||||
|
|
Loading…
Reference in a new issue