feat(gs/emacs): Include repo in PR links

When posting a link to a PR created during an org headline, include the
name of the repository the PR was opened to in the link text.

Change-Id: I6c564aee3b098d3c6f96c7d7d609aa2638bc98e1
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2063
Reviewed-by: glittershark <grfn@gws.fyi>
Tested-by: BuildkiteCI
This commit is contained in:
Griffin Smith 2020-10-26 13:31:15 -04:00 committed by glittershark
parent d358b81a10
commit aa0b4e430c

View file

@ -155,7 +155,19 @@
(number (alist-get 'number value)))
(org-set-property
"pull-request"
(org-make-link-string url (number-to-string number)))))))))
(org-make-link-string
url
(format "%s/%s/%d"
(->> value
(alist-get 'base)
(alist-get 'repo)
(alist-get 'name))
(->> value
(alist-get 'base)
(alist-get 'repo)
(alist-get 'owner)
(alist-get 'login))
number)))))))))
(advice-add
#'forge--post-submit-callback