Trying to execute a GitHub Actions workflow that creates a xlsx file and upload the file to S3 bucket and getting the error:
AccessControlListNotSupported: The bucket does not allow ACLs
The error pops up when the GitHub Actions workflow is executed, however when I execute it from the localhost environment it works normally.
I've already defined permissions for "Object Ownership, Access control list (ACL), Bucket policy.
Bucket Policy

Access Control List (ACL)

Object Ownership

Block public access (bucket settings)

const aclHeader = 'public-read';
return client.send(
new PutObjectCommand({
Bucket: bucket,
Key: filename,
Body: xlsxContent,
ContentType:
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
ACL: aclHeader,
})
);
Verify you have not put an enforcement mechanism in place that could be blocking the use of ACLs despite your settings. https://docs.aws.amazon.com/AmazonS3/latest/userguide/ensure-object-ownership.html