diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e9a747f15319a5eba4d361c08bcb87f20154122a..ea6e258931faed2d1a8adcaddc0d0c5bb30889ce 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -63,15 +63,19 @@ register package: ); ' - # Remove credentials from Package.toml files + # Sanitize the Package.toml files after registration - find /tmp/registry -name 'Package.toml' -exec sed -i 's|https://.*@|https://|g' {} \; - # Stage and commit sanitized changes + # Check for changes and commit sanitized updates if any - | cd /tmp/registry - git add . - git commit -m "Sanitize Package.toml: Remove secrets from repo field" - + if ! git diff --quiet; then + git add . + git commit -m "Sanitize Package.toml: Remove secrets from repo field" + else + echo "No changes detected, skipping commit." + fi + # Push changes to the registry - | cd /tmp/registry