Commit after checkout.

This commit is contained in:
Alexander Artemenko 2021-02-07 03:06:14 +03:00
parent 4a1261cd8a
commit 3ebc39835f

View file

@ -159,6 +159,7 @@ behaviour could be overriden by keyword argument ``:raise t``."
((git-repository-was-changed-p) ((git-repository-was-changed-p)
(log:info "Pushing local changes to the repository") (log:info "Pushing local changes to the repository")
(flet ((make-commit ()
(git "add -u") (git "add -u")
;; We don't want to commit changes to qlfile, ;; We don't want to commit changes to qlfile,
@ -170,8 +171,7 @@ behaviour could be overriden by keyword argument ``:raise t``."
(git "config --global user.name \"github-actions[bot]\"") (git "config --global user.name \"github-actions[bot]\"")
(git "config --global user.email \"actions@github.com\"")) (git "config --global user.email \"actions@github.com\""))
(git "commit -m 'Update docs'") (git "commit -m 'Update docs'")))
(cond (cond
((uiop:getenv "GITHUB_HEAD_REF") ((uiop:getenv "GITHUB_HEAD_REF")
(let ((ref (uiop:getenv "GITHUB_HEAD_REF"))) (let ((ref (uiop:getenv "GITHUB_HEAD_REF")))
@ -184,11 +184,13 @@ behaviour could be overriden by keyword argument ``:raise t``."
;; To push changes back, we need to change ;; To push changes back, we need to change
;; our HEAD back to the pull-request's reference: ;; our HEAD back to the pull-request's reference:
(git "checkout " ref) (git "checkout " ref)
(make-commit)
(git "remote add upstream " (git "remote add upstream "
(get-origin-to-push)) (get-origin-to-push))
(git "push upstream HEAD:" ref))) (git "push upstream HEAD:" ref)))
(t (t
(git "push")))) (make-commit)
(git "push")))))
;; or ;; or
(t (log:info "There is no local changes."))))) (t (log:info "There is no local changes.")))))