mirror of
https://gitee.com/jack_whh/actions-s3-caching.git
synced 2026-03-10 06:52:54 +08:00
actually build the thing
This commit is contained in:
9882
dist/restore/index.js
vendored
9882
dist/restore/index.js
vendored
File diff suppressed because it is too large
Load Diff
9882
dist/save/index.js
vendored
9882
dist/save/index.js
vendored
File diff suppressed because it is too large
Load Diff
2863
package-lock.json
generated
2863
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "cache-s3",
|
"name": "actions-s3-caching",
|
||||||
"version": "1.0.0",
|
"version": "1.0.3",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "Cache dependencies and build outputs",
|
"description": "Cache dependencies and build outputs",
|
||||||
"main": "dist/restore/index.js",
|
"main": "dist/restore/index.js",
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git+https://github.com/dmolik/actions-cache-s3.git"
|
"url": "git+https://github.com/dmolik/actions-s3-caching.git"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"actions",
|
"actions",
|
||||||
@@ -29,7 +29,8 @@
|
|||||||
"@actions/io": "^1.1.0",
|
"@actions/io": "^1.1.0",
|
||||||
"@aws-sdk/client-s3": "^3.51.0",
|
"@aws-sdk/client-s3": "^3.51.0",
|
||||||
"@aws-sdk/types": "^3.50.0",
|
"@aws-sdk/types": "^3.50.0",
|
||||||
"@aws-sdk/credential-providers": "^3.50.0"
|
"@aws-sdk/client-sts": "^3.50.0",
|
||||||
|
"@aws-sdk/credential-provider-web-identity": "^3.50.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jest": "^27.4.0",
|
"@types/jest": "^27.4.0",
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
import * as core from "@actions/core";
|
import * as core from "@actions/core";
|
||||||
import { Inputs, Outputs, RefKey, State } from "../constants";
|
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-providers";
|
import { fromTokenFile } from "@aws-sdk/credential-provider-web-identity";
|
||||||
|
import { getDefaultRoleAssumerWithWebIdentity } from "@aws-sdk/client-sts";
|
||||||
|
|
||||||
export function isGhes(): boolean {
|
export function isGhes(): boolean {
|
||||||
const ghUrl = new URL(
|
const ghUrl = new URL(
|
||||||
@@ -81,16 +82,18 @@ export function getInputS3ClientConfig(): S3ClientConfig | undefined {
|
|||||||
if (!s3BucketName) {
|
if (!s3BucketName) {
|
||||||
return undefined
|
return undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
const credentials = core.getInput(Inputs.AWSAccessKeyId) ? {
|
const credentials = core.getInput(Inputs.AWSAccessKeyId) ? {
|
||||||
credentials: {
|
credentials: {
|
||||||
accessKeyId: core.getInput(Inputs.AWSAccessKeyId),
|
accessKeyId: core.getInput(Inputs.AWSAccessKeyId),
|
||||||
secretAccessKey: core.getInput(Inputs.AWSSecretAccessKey)
|
secretAccessKey: core.getInput(Inputs.AWSSecretAccessKey)
|
||||||
}
|
}
|
||||||
} : {
|
} : {
|
||||||
credentials: {
|
credentials: fromTokenFile({
|
||||||
fromTokenFile({})
|
roleAssumerWithWebIdentity: getDefaultRoleAssumerWithWebIdentity(),
|
||||||
}
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const s3config = {
|
const s3config = {
|
||||||
...credentials,
|
...credentials,
|
||||||
region: core.getInput(Inputs.AWSRegion),
|
region: core.getInput(Inputs.AWSRegion),
|
||||||
|
|||||||
Reference in New Issue
Block a user