Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cache #34

Merged
merged 7 commits into from
Oct 13, 2024
Merged
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
33 changes: 33 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Changelog


## v0.0.7

[compare changes](https://github.com/brenoepics/vmd-action/compare/v0.0.6...v0.0.7)

### 🚀 Enhancements

- Support GitHub Enterprise repositories ([2db2516](https://github.com/brenoepics/vmd-action/commit/2db2516))

### 🩹 Fixes

- Cache file missmatch ([1bfaa16](https://github.com/brenoepics/vmd-action/commit/1bfaa16))

### 💅 Refactors

- `action.yml` and `README.md` to improve descriptions and usage instructions ([43b7ed8](https://github.com/brenoepics/vmd-action/commit/43b7ed8))

### 🏡 Chore

- Update preview ([#30](https://github.com/brenoepics/vmd-action/pull/30))
- Bump dist ([421b588](https://github.com/brenoepics/vmd-action/commit/421b588))
- Move the "Usage" section up, after the "Installation" section ([1577226](https://github.com/brenoepics/vmd-action/commit/1577226))
- Update `README.md` to improve usage instructions ([fff0472](https://github.com/brenoepics/vmd-action/commit/fff0472))
- Bump dist ([6332497](https://github.com/brenoepics/vmd-action/commit/6332497))
- Lint ([ed3b91e](https://github.com/brenoepics/vmd-action/commit/ed3b91e))
- Add changelogen ([bb7a5c1](https://github.com/brenoepics/vmd-action/commit/bb7a5c1))

### ❤️ Contributors

- Breno A. ([@brenoepics](http://github.com/brenoepics))

18 changes: 11 additions & 7 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -144179,12 +144179,14 @@ function replaceCodeHealth(message, health, template) {
return replacePlaceholders(message, health);
}
function replaceRepoData(message, artifactId) {
const context = lib_github.context;
return message
.replace(/{{serverUrl}}/g, context.serverUrl)
.replace(/{{runId}}/g, context.runId.toString())
.replace(/{{repositoryName}}/g, context.repo.repo)
.replace(/{{repositoryOwner}}/g, context.repo.owner)
.replace(/{{artifactText}}/g, artifactId ? artifactText : "")
.replace(/{{artifactId}}/g, String(artifactId ?? 0))
.replace(/{{runId}}/g, lib_github.context.runId.toString())
.replace(/{{repositoryName}}/g, lib_github.context.repo.repo)
.replace(/{{repositoryOwner}}/g, lib_github.context.repo.owner);
.replace(/{{artifactId}}/g, String(artifactId ?? 0));
}
function replaceBadges(message, badges) {
return message.replace(/{{coverageBadge}}/g, badges.join(" "));
Expand Down Expand Up @@ -144332,7 +144334,7 @@ const newCoverageInfo = `
📁 Total Files: {{filesCount}}
`;
const artifactText = `
🔍 [Download Full Analysis Details](https://github.com/{{repositoryOwner}}/{{repositoryName}}/actions/runs/{{runId}}/artifacts/{{artifactId}})
🔍 [Download Full Analysis Details]({{serverUrl}}/{{repositoryOwner}}/{{repositoryName}}/actions/runs/{{runId}}/artifacts/{{artifactId}})
`;
function getCommentTemplate(result, artifactId) {
const coverageTemplate = result.relativeAnalysis
Expand Down Expand Up @@ -144567,8 +144569,10 @@ var cache = __nccwpck_require__(10184);




const workflow = lib_github.context.workflow;
async function saveCache(filePath, branch) {
const cacheId = `vmd-analysis-${branch}`;
const cacheId = `vmd-analysis-${branch}-${workflow}`;
const cachePaths = [filePath];
try {
await cache.saveCache(cachePaths, cacheId);
Expand All @@ -144578,7 +144582,7 @@ async function saveCache(filePath, branch) {
}
}
async function restoreCache(branch, cachePath) {
const cacheId = `vmd-analysis-${branch}`;
const cacheId = `vmd-analysis-${branch}-${workflow}`;
try {
const cacheKey = await cache.restoreCache([cachePath], cacheId);
if (cacheKey) {
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vmd-action",
"version": "0.0.6",
"version": "0.0.7",
"description": "",
"main": "dist/index.js",
"type": "module",
Expand All @@ -16,6 +16,7 @@
"package:watch": "pnpm run package --watch",
"test": "pnpm vitest --coverage --run",
"prepublishOnly": "pnpm run clean && pnpm install && pnpm run build",
"release": "pnpm preflight && changelogen --release --bump && git push --follow-tags",
"preflight": "pnpm install && pnpm run format:write && pnpm run lint && pnpm run test && pnpm run package",
"prepare": "husky"
},
Expand All @@ -35,6 +36,7 @@
"@typescript-eslint/parser": "^7.18.0",
"@vercel/ncc": "^0.38.2",
"@vitest/coverage-v8": "2.1.2",
"changelogen": "0.5.7",
"eslint": "^8.57.1",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
Expand Down
Loading