5 Commits

Author SHA1 Message Date
dependabot[bot]
b128659e46 Bump minimatch from 3.0.4 to 3.1.2
Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.0.4 to 3.1.2.
- [Release notes](https://github.com/isaacs/minimatch/releases)
- [Commits](https://github.com/isaacs/minimatch/compare/v3.0.4...v3.1.2)

---
updated-dependencies:
- dependency-name: minimatch
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-13 09:46:42 +00:00
Dan Molik
1b18c184b7 need parens? 2022-10-13 17:34:26 -04:00
Dan Molik
f544c6adbb bad '()' ? 2022-10-13 12:45:24 -04:00
Dan Molik
c243dcc946 actually build the thing 2022-10-13 12:26:42 -04:00
Dan Molik
e5aa7db291 fix irsa support 2022-10-13 11:10:39 -04:00
5 changed files with 16801 additions and 6393 deletions

9882
dist/restore/index.js vendored

File diff suppressed because it is too large Load Diff

9882
dist/save/index.js vendored

File diff suppressed because it is too large Load Diff

3408
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "cache-s3",
"version": "1.0.0",
"name": "actions-s3-caching",
"version": "1.0.5",
"private": true,
"description": "Cache dependencies and build outputs",
"main": "dist/restore/index.js",
@@ -13,7 +13,7 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/dmolik/actions-cache-s3.git"
"url": "git+https://github.com/dmolik/actions-s3-caching.git"
},
"keywords": [
"actions",
@@ -29,6 +29,7 @@
"@actions/io": "^1.1.0",
"@aws-sdk/client-s3": "^3.51.0",
"@aws-sdk/types": "^3.50.0",
"@aws-sdk/client-sts": "^3.50.0",
"@aws-sdk/credential-provider-web-identity": "^3.50.0"
},
"devDependencies": {

View File

@@ -1,9 +1,8 @@
import * as core from "@actions/core";
import { Inputs, Outputs, RefKey, State } from "../constants";
import {CommonPrefix, InputSerialization, S3ClientConfig} from "@aws-sdk/client-s3";
import { CommonPrefix, InputSerialization, S3ClientConfig } from "@aws-sdk/client-s3";
import { fromTokenFile } from "@aws-sdk/credential-provider-web-identity";
import { getDefaultRoleAssumerWithWebIdentity } from "@aws-sdk/client-sts";
export function isGhes(): boolean {
const ghUrl = new URL(
@@ -83,14 +82,18 @@ export function getInputS3ClientConfig(): S3ClientConfig | undefined {
if (!s3BucketName) {
return undefined
}
const credentials = core.getInput(Inputs.AWSAccessKeyId) ? {
credentials: {
accessKeyId: core.getInput(Inputs.AWSAccessKeyId),
secretAccessKey: core.getInput(Inputs.AWSSecretAccessKey)
}
} : fromTokenFile({
roleAssumerWithWebIdentity: getDefaultRoleAssumerWithWebIdentity()
})
} : {
credentials: fromTokenFile({
roleAssumerWithWebIdentity: getDefaultRoleAssumerWithWebIdentity(),
})
}
const s3config = {
...credentials,
region: core.getInput(Inputs.AWSRegion),