diff --git a/ci/blackduck.yml b/ci/blackduck.yml index 123c0a7a80..6b5f7aed44 100644 --- a/ci/blackduck.yml +++ b/ci/blackduck.yml @@ -174,8 +174,11 @@ jobs: latest=$(git ls-remote https://github.com/DACH-NY/security-blackduck.git master | awk '{print $1}') current=$(cat ci/blackduck.yml | grep blackduck_script_sha: | head -1 | cut -f2 -d: | cut -c2- ) - if [ "$current" != "$latest" ]; then - branch="bump-blackduck-script-${latest:0:8}" + branch="bump-blackduck-script-${latest:0:8}" + + if git ls-remote --exit-code --heads https://github.com/digital-asset/daml.git refs/heads/$branch >/dev/null; then + echo "$branch already exists, nothing to do." + elif [ "$current" != "$latest" ]; then echo "s|blackduck_script_sha: $current|blackduck_script_sha: $latest|" sed -i "s|blackduck_script_sha: $current|blackduck_script_sha: $latest|" ci/blackduck.yml git add ci/blackduck.yml