diff --git a/.gitlab/ci/.gitlab-ci.global.yml b/.gitlab/ci/.gitlab-ci.global.yml index c7df44c12e4a..462aae58ef90 100644 --- a/.gitlab/ci/.gitlab-ci.global.yml +++ b/.gitlab/ci/.gitlab-ci.global.yml @@ -234,7 +234,7 @@ .checkout-upload-commit-content-nightly: &checkout-upload-commit-content-nightly - section_start "Checkout upload commit content nightly" --collapsed - | - if [[ -n "${NIGHTLY}" && "${CI_COMMIT_BRANCH}" == "master" ]]; then + if [[ -n "${NIGHTLY}" && "${CI_COMMIT_BRANCH}" == "master" && ${LAST_UPLOAD_COMMIT} != ${CI_COMMIT_SHA} ]]; then if [[ ! -d "${CI_PROJECT_DIR}/artifacts/production_packs" ]]; then echo "content production packs do not exist in ${CI_PROJECT_DIR}/artifacts" exit 1 @@ -245,7 +245,9 @@ git config core.fileMode false # used to tell git not to identify permission changes on files as changes chmod -R 777 ./Packs # required for the lint, we use the permissions of the file when running pytest within the containers echo "the Packs changes between upload commit ${LAST_UPLOAD_COMMIT} to master commit ${CI_COMMIT_SHA} is:" - git status -- Packs # show the differences between the upload commit to the master branch for the Packs folder + git status -- Packs # show the differences between the upload commit to the master branch for the Packs folder before commit + git commit -am "updated branch to upload commit ${LAST_UPLOAD_COMMIT}" + git status -- Packs # show the differences between the upload commit to the master branch for the Packs folder after commit echo "The Packs folder is in the state of commit $LAST_UPLOAD_COMMIT" else echo "not checking out to the latest upload commit $LAST_UPLOAD_COMMIT because the build is not content nightly"