in src/reqfile-to-artifact/reqfile-to-artifact.py [0:0]
def upload_file(file_name: str, bucket: str, object_name: str =None) -> None:
"""
Upload a file to a S3 bucket.
"""
# If S3 object_name was not specified, use file_name
if object_name is None:
object_name = file_name
# Upload the file
s3_client = boto3.client("s3")
try:
s3_client.upload_file(file_name, bucket, object_name)
except ClientError as e:
logging.error(e)