diff --git a/lib/plugins/aws/deploy-list.js b/lib/plugins/aws/deploy-list.js index 6f856ed5e..1ce3fb081 100644 --- a/lib/plugins/aws/deploy-list.js +++ b/lib/plugins/aws/deploy-list.js @@ -35,7 +35,7 @@ class AwsDeployList { try { response = await this.provider.request('S3', 'listObjectsV2', { Bucket: this.bucketName, - Prefix: `${prefix}/${service}/${stage}`, + Prefix: `${prefix}/${service}/${stage}/`, }); } catch (err) { if (err.code === 'AWS_S3_LIST_OBJECTS_V2_ACCESS_DENIED') { diff --git a/test/unit/lib/plugins/aws/deploy-list.test.js b/test/unit/lib/plugins/aws/deploy-list.test.js index b56ad0f09..6e5cc27d7 100644 --- a/test/unit/lib/plugins/aws/deploy-list.test.js +++ b/test/unit/lib/plugins/aws/deploy-list.test.js @@ -39,7 +39,7 @@ describe('AwsDeployList', () => { expect( listObjectsStub.calledWithExactly('S3', 'listObjectsV2', { Bucket: awsDeployList.bucketName, - Prefix: `${s3Key}`, + Prefix: `${s3Key}/`, }) ).to.be.equal(true); awsDeployList.provider.request.restore(); @@ -62,7 +62,7 @@ describe('AwsDeployList', () => { expect( listObjectsStub.calledWithExactly('S3', 'listObjectsV2', { Bucket: awsDeployList.bucketName, - Prefix: `${s3Key}`, + Prefix: `${s3Key}/`, }) ).to.be.equal(true); awsDeployList.provider.request.restore();