<commit_before>{ buildToolbox
, checkedShellScript
, curl
, jq
}:
let
  dockerHubDescription =
    let
      description =
        ./docker-hub-description.md;

      fullDescription =
        ./docker-hub-full-description.md;
    in
    checkedShellScript
      {
        name = "postgrest-release-dockerhub-description";
        docs = "Update the repository description on Docker Hub.";
        args = [
          "ARG_USE_ENV([DOCKER_USER], [], [DockerHub user name])"
          "ARG_USE_ENV([DOCKER_PASS], [], [DockerHub password])"
          "ARG_USE_ENV([DOCKER_REPO], [], [DockerHub repository])"
        ];
      }
      ''
        # ARG_USE_ENV only adds defaults or docs for environment variables
        # We manually implement a required check here
        # See also: https://github.com/matejak/argbash/issues/80
        DOCKER_USER="''${DOCKER_USER:?DOCKER_USER is required}"
        DOCKER_PASS="''${DOCKER_PASS:?DOCKER_PASS is required}"
        DOCKER_REPO="''${DOCKER_REPO:?DOCKER_REPO is required}"

        echo "Logging in to Docker Hub to get an auth token..."
        token="$(
          ${curl}/bin/curl --fail -s \
            --data-urlencode "username=$DOCKER_USER" \
            --data-urlencode "password=$<PASSWORD>" \
            "https://hub.docker.com/v2/users/login/" \
           | ${jq}/bin/jq -r .token
        )"

        repo_url="https://hub.docker.com/v2/repositories/$DOCKER_REPO/postgrest/"
        echo "Patching both descriptions at $repo_url ..." 
        ${curl}/bin/curl --fail -X PATCH "$repo_url" \
          -H "Authorization: JWT $token" \
          --data-urlencode description@${description} \
          --data-urlencode full_description@${fullDescription}
      '';
in
buildToolbox<commit_msg>nix(refactor): Make checking for required environment variables a no-op<commit_after>{ buildToolbox
, checkedShellScript
, curl
, jq
}:
let
  dockerHubDescription =
    let
      description =
        ./docker-hub-description.md;

      fullDescription =
        ./docker-hub-full-description.md;
    in
    checkedShellScript
      {
        name = "postgrest-release-dockerhub-description";
        docs = "Update the repository description on Docker Hub.";
        args = [
          "ARG_USE_ENV([DOCKER_USER], [], [DockerHub user name])"
          "ARG_USE_ENV([DOCKER_PASS], [], [DockerHub password])"
          "ARG_USE_ENV([DOCKER_REPO], [], [DockerHub repository])"
        ];
      }
      ''
        # ARG_USE_ENV only adds defaults or docs for environment variables
        # We manually implement a required check here
        # See also: https://github.com/matejak/argbash/issues/80
        : "''${DOCKER_USER:?DOCKER_USER is required}"
        : "''${DOCKER_PASS:?DOCKER_PASS is required}"
        : "''${DOCKER_REPO:?DOCKER_REPO is required}"

        echo "Logging in to Docker Hub to get an auth token..."
        token="$(
          ${curl}/bin/curl --fail -s \
            --data-urlencode "username=$DOCKER_USER" \
            --data-urlencode "password=$<PASSWORD>" \
            "https://hub.docker.com/v2/users/login/" \
           | ${jq}/bin/jq -r .token
        )"

        repo_url="https://hub.docker.com/v2/repositories/$DOCKER_REPO/postgrest/"
        echo "Patching both descriptions at $repo_url ..." 
        ${curl}/bin/curl --fail -X PATCH "$repo_url" \
          -H "Authorization: JWT $token" \
          --data-urlencode description@${description} \
          --data-urlencode full_description@${fullDescription}
      '';
in
buildToolbox
{'fraction_non_alphanumeric': 0.13556437889960296, 'fraction_numerical': 0.0022688598979013048, 'mean_word_length': 2.268767377201112, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4414137', 'n_tokens_mistral': 1127, 'n_tokens_neox': 1077, 'n_words': 223}