From 92794e6dbe7f25f2bf1353298d7d1b4d24060ce0 Mon Sep 17 00:00:00 2001 From: Alexander Artemenko Date: Sun, 7 Feb 2021 02:13:42 +0300 Subject: [PATCH] Checkout pull's ref before push. --- .github/actions/build-docs/upload.ros | 18 +++++++++++++----- README.md | 1 + qlfile | 1 + 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/.github/actions/build-docs/upload.ros b/.github/actions/build-docs/upload.ros index cb0525d..762a836 100755 --- a/.github/actions/build-docs/upload.ros +++ b/.github/actions/build-docs/upload.ros @@ -170,11 +170,19 @@ behaviour could be overriden by keyword argument ``:raise t``." (cond ((uiop:getenv "GITHUB_HEAD_REF") - - (git "remote add upstream " - (get-origin-to-push)) - (git "push upstream HEAD:" - (uiop:getenv "GITHUB_HEAD_REF"))) + (let ((ref (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 diff --git a/README.md b/README.md index 617bea2..feab30c 100644 --- a/README.md +++ b/README.md @@ -106,3 +106,4 @@ System: some-other-system is not available * * * ###### \[generated by [MGL-PAX](https://github.com/melisgl/mgl-pax)\] + diff --git a/qlfile b/qlfile index b91f000..7b904c0 100644 --- a/qlfile +++ b/qlfile @@ -1 +1,2 @@ dist ultralisp http://dist.ultralisp.org +