def add_private_pack(private_packs, private_pack_metadata, changed_pack_id):
    """Add a new or existing private pack to the list of private packs,
    that will later be added to index.json.

    Args:
        private_packs (list): The current list of private packs, not including the one to be added.
        private_pack_metadata (dict): The metadata of the private pack.
        changed_pack_id (str): The ID of the pack that was added / modified in the current private build.

    Returns:
        private_packs (list): The modified list of private packs, including the added pack.
    """
    if private_pack_metadata:
        private_packs.append({
            'id': changed_pack_id,
            'price': int(private_pack_metadata.get('price')),
            'vendorId': private_pack_metadata.get('vendorId', ""),
            'partnerId': private_pack_metadata.get('partnerId', ""),
            'partnerName': private_pack_metadata.get('partnerName', ""),
            'contentCommitHash': private_pack_metadata.get('contentCommitHash', "")
        })
    return private_packs