From 748c70fff7bc68dbbf811269138f89d10a953642 Mon Sep 17 00:00:00 2001 From: Jim Hamill Date: Sun, 16 Feb 2025 05:18:04 +0000 Subject: [PATCH] Fix CI detached HEAD issue --- .gitlab-ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e46e575..b76ca2a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -42,6 +42,11 @@ publish:development: # Configure git to push with CI token - git remote set-url origin "https://oauth2:${CI_JOB_TOKEN}@gitlab.com/${CI_PROJECT_PATH}.git" + # Checkout the branch instead of detached HEAD + # NOTE: GitLab CI will use a detached HEAD + - git checkout -B ${CI_COMMIT_REF_NAME} + - git pull origin ${CI_COMMIT_REF_NAME} + # Setup npm config for npmjs.com - npm config set registry https://registry.npmjs.org/ - npm config set //registry.npmjs.org/:_authToken ${NPM_AUTH_TOKEN}