Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Dependency directory
node_modules
.idea
.vscode

# Rest pulled from https://github.com/github/gitignore/blob/master/Node.gitignore
# Logs
Expand Down
212 changes: 106 additions & 106 deletions dist/main/index.js

Large diffs are not rendered by default.

198 changes: 99 additions & 99 deletions dist/post/index.js

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gcs-cache",
"version": "1.0.0",
"version": "1.0.1",
"description": "Cache your workload to a Google Cloud Storage bucket",
"scripts": {
"build": "tsc",
Expand All @@ -13,7 +13,7 @@
},
"repository": {
"type": "git",
"url": "git@github.com:pass-culture-github-actions/gcs-cache.git"
"url": "git@github.com:halradaideh/gcs-cache.git"
},
"keywords": [
"actions",
Expand All @@ -24,7 +24,7 @@
"author": "Dimitri Kopriwa <dimitri.kopriwa@passculture.fr>",
"license": "MIT",
"bugs": {
"url": "https://github.com/pass-culture-github-actions/gcs-cache/issues"
"url": "https://github.com/halradaideh/gcs-cache/issues"
},
"husky": {
"hooks": {
Expand All @@ -48,7 +48,7 @@
"*.{js,jsx,ts,tsx}": "eslint --fix",
"*.{md,yml,html,css,scss,json}": "prettier --write"
},
"homepage": "https://github.com/pass-culture-github-actions/gcs-cache#readme",
"homepage": "https://github.com/halradaideh/gcs-cache#readme",
"devDependencies": {
"@commitlint/cli": "17.4.4",
"@commitlint/config-conventional": "17.4.4",
Expand Down Expand Up @@ -80,7 +80,7 @@
"@actions/exec": "1.1.1",
"@actions/github": "5.1.1",
"@actions/glob": "0.4.0",
"@google-cloud/storage": "6.9.4",
"@google-cloud/storage": "7.8.0",
"semver": "7.3.8",
"tmp-promise": "3.0.3"
},
Expand Down
10 changes: 6 additions & 4 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ async function getBestMatch(
.then(([files]) =>
files.sort(
(a, b) =>
new Date((b.metadata as ObjectMetadata).updated).getTime() -
new Date((a.metadata as ObjectMetadata).updated).getTime(),
new Date(
(b.metadata as unknown as ObjectMetadata).updated,
).getTime() -
new Date((a.metadata as unknown as ObjectMetadata).updated).getTime(),
),
)
.catch((err) => {
Expand All @@ -54,7 +56,7 @@ async function getBestMatch(
bucketFiles.map((f) => ({
name: f.name,
metadata: {
updated: (f.metadata as ObjectMetadata).updated,
updated: (f.metadata as unknown as ObjectMetadata).updated,
},
})),
)}.`,
Expand Down Expand Up @@ -111,7 +113,7 @@ async function main() {

const bestMatchMetadata = await bestMatch
.getMetadata()
.then(([metadata]) => metadata as ObjectMetadata)
.then(([metadata]) => metadata as unknown as ObjectMetadata)
.catch((err) => {
core.error('Failed to read object metadatas');
throw err;
Expand Down
Loading