Skip to content

Commit

Permalink
Check that upload and master commits are different
Browse files Browse the repository at this point in the history
  • Loading branch information
MosheEichler committed Feb 19, 2024
1 parent ec9e097 commit a19f9fb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .gitlab/ci/.gitlab-ci.global.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down

0 comments on commit a19f9fb

Please sign in to comment.