[neon/ubuntu-core/ago/generate-model-in-ci] debian: Fix push remote and MR-only rule

Antoine Gonzalez null at kde.org
Thu Jul 25 16:04:56 BST 2024


Git commit 368c5b00888a1209e024d26dcac43b8fd0cb158e by Antoine Gonzalez.
Committed on 25/07/2024 at 15:04.
Pushed by daspood into branch 'ago/generate-model-in-ci'.

Fix push remote and MR-only rule

M  +3    -2    debian/snap-image-model.yml

https://invent.kde.org/neon/ubuntu-core/-/commit/368c5b00888a1209e024d26dcac43b8fd0cb158e

diff --git a/debian/snap-image-model.yml b/debian/snap-image-model.yml
index 566fe52..ff66d4d 100644
--- a/debian/snap-image-model.yml
+++ b/debian/snap-image-model.yml
@@ -38,10 +38,10 @@ snap_image_model:
     - echo pushing new models to branch $CI_COMMIT_REF_NAME
     - git config user.email "kde-neon-core-model-bot at kde.org"
     - git config user.name "kde-neon-core model-bot"
-    - git remote add gitlab_origin https://oauth2:$UBUNTU_NEON_CORE_ACCESS_TOKEN@invent.kde.org:neon/ubuntu-core.git
+    - git remote add origin_push https://oauth2:$UBUNTU_NEON_CORE_ACCESS_TOKEN@invent.kde.org:neon/ubuntu-core.git || git remote set-url origin_push https://oauth2:$UBUNTU_NEON_CORE_ACCESS_TOKEN@invent.kde.org:neon/ubuntu-core.git
     - git add ./*.model
     - git commit -m "Update model files"
-    - git push gitlab_origin HEAD:$CI_COMMIT_REF_NAME -o ci.skip
+    - git push origin_push HEAD:$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME -o ci.skip
   interruptible: true
   after_script:
     # delete the gpg keyring
@@ -49,5 +49,6 @@ snap_image_model:
     # delete the snapcraft auth creds
     - rm kde-neon-core-image-key
   rules:
+    - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
     - changes:
       - kde-neon-core-amd64.json  # Only re-generate the models when the base model json is changed


More information about the Neon-commits mailing list