Checkout pull's ref before push.

This commit is contained in:
Alexander Artemenko 2021-02-07 02:13:42 +03:00
parent 858def8938
commit 92794e6dbe
3 changed files with 15 additions and 5 deletions

View file

@ -170,11 +170,19 @@ behaviour could be overriden by keyword argument ``:raise t``."
(cond
((uiop:getenv "GITHUB_HEAD_REF")
(let ((ref (uiop:getenv "GITHUB_HEAD_REF")))
(git "remote add upstream "
(get-origin-to-push))
(git "push upstream HEAD:"
(uiop:getenv "GITHUB_HEAD_REF")))
;; Inside github action we are running on
;; detached commit. Github takes last commit
;; from the "master" branch and merges
;; a branch from pull-request settings.
;;
;; To push changes back, we need to change
;; our HEAD back to the pull-request's reference:
(git "checkout" ref)
(git "remote add upstream "
(get-origin-to-push))
(git "push upstream HEAD:" ref)))
(t
(git "push"))))
;; or

View file

@ -106,3 +106,4 @@ System: some-other-system is not available
* * *
###### \[generated by [MGL-PAX](https://github.com/melisgl/mgl-pax)\]

1
qlfile
View file

@ -1 +1,2 @@
dist ultralisp http://dist.ultralisp.org