{
  pkgs,
  buildRoot,
  projectDefinition,
  ...
}: let
  common = import ./common.nix {inherit pkgs;};
in ''
  #!${pkgs.bash}/bin/bash
  ${common}

  echo_section "Deleting pipelines"

  pipeline_list=$(${pkgs.glab}/bin/glab ci list)

  commit_hashes=$(echo "$pipeline_list" | awk '/#/{print $3}')
  for hash in $commit_hashes; do
      hh=$(echo "$hash" |  ${pkgs.coreutils}/bin/cut -d"#" -f2)
      echo_step "Deleting pipeline for commit $hh"
      ${pkgs.glab}/bin/glab ci delete "$hh"
  done

  echo_ok "All pipelines deleted"

''