mirror of
https://code.forgejo.org/actions/cache.git
synced 2025-04-22 16:53:57 +08:00
try this
This commit is contained in:
parent
d9e985924e
commit
2377d067bc
4 changed files with 31 additions and 46 deletions
22
dist/restore/index.js
vendored
22
dist/restore/index.js
vendored
|
@ -43330,20 +43330,14 @@ class CacheService {
|
|||
uploadToS3(key, archivePath) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const client = new aws_sdk_1.S3();
|
||||
// Read in the file, convert it to base64, store to S3
|
||||
fs_1.default.readFile(archivePath, (err, data) => {
|
||||
if (err) {
|
||||
throw err;
|
||||
}
|
||||
const base64data = data.toString("base64");
|
||||
client
|
||||
.putObject({
|
||||
Bucket: this._bucket,
|
||||
Key: key,
|
||||
Body: base64data
|
||||
})
|
||||
.send();
|
||||
});
|
||||
const data = fs_1.default.readFileSync(archivePath).toString("base64");
|
||||
return client
|
||||
.putObject({
|
||||
Bucket: this._bucket,
|
||||
Key: key,
|
||||
Body: data
|
||||
})
|
||||
.promise();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue