Skip to content

Commit 4f28476

Browse files
committed
🚸 Make the default keys version-dependent from code
1 parent 9a2e0b6 commit 4f28476

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,8 @@ with:
271271
| `artifact-name` | Specify Qodana results artifact name, used for results uploading. Optional. | `qodana-report` |
272272
| `cache-dir` | Directory to store Qodana cache. Optional. | `${{ runner.temp }}/qodana/caches` |
273273
| `use-caches` | Utilize [GitHub caches](https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#usage-limits-and-eviction-policy) for Qodana runs. Optional. | `true` |
274-
| `primary-cache-key` | Set [the primary cache key](https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key). Optional. | `qodana-2023.1-${{ github.ref }}-${{ github.sha }}` |
275-
| `additional-cache-key` | Set [the additional cache key](https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key). Optional. | `qodana-2023.1-${{ github.ref }}` |
274+
| `primary-cache-key` | Set [the primary cache key](https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key). Optional. | `qodana-2023.2-${{ github.ref }}-${{ github.sha }}` |
275+
| `additional-cache-key` | Set [the additional cache key](https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key). Optional. | `qodana-2023.2-${{ github.ref }}` |
276276
| `cache-default-branch-only` | Upload cache for the default branch only. Optional. | `false` |
277277
| `use-annotations` | Use annotation to mark the results in the GitHub user interface. Optional. | `true` |
278278
| `pr-mode` | Analyze ONLY changed files in a pull request. Optional. | `true` |

action.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ inputs:
2424
primary-cache-key:
2525
description: 'Set the primary cache key'
2626
required: false
27-
default: "qodana-2023.1-${{ github.ref }}-${{ github.sha }}"
27+
default: ""
2828
additional-cache-key:
2929
description: 'Set the additional cache key'
3030
required: false
31-
default: "qodana-2023.1-${{ github.ref }}"
31+
default: ""
3232
additional-cache-hash:
3333
description: 'Pass additional cache hash extension'
3434
required: false

scan/dist/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69166,8 +69166,8 @@ var require_utils8 = __commonJS({
6916669166
args: core2.getInput("args").split(",").map((arg) => arg.trim()),
6916769167
resultsDir: core2.getInput("results-dir"),
6916869168
cacheDir: core2.getInput("cache-dir"),
69169-
primaryCacheKey: core2.getInput("primary-cache-key"),
69170-
additionalCacheKey: core2.getInput("additional-cache-key") || core2.getInput("additional-cache-hash"),
69169+
primaryCacheKey: core2.getInput("primary-cache-key") || `qodana-${qodana_12.VERSION}-${process.env.GITHUB_REF}-${process.env.GITHUB_SHA}`,
69170+
additionalCacheKey: core2.getInput("additional-cache-key") || core2.getInput("additional-cache-hash") || `qodana-${qodana_12.VERSION}-${process.env.GITHUB_REF}}-`,
6917169171
cacheDefaultBranchOnly: core2.getBooleanInput("cache-default-branch-only"),
6917269172
uploadResult: core2.getBooleanInput("upload-result"),
6917369173
uploadSarif: false,

scan/src/utils.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,13 @@ export function getInputs(): Inputs {
5454
.map(arg => arg.trim()),
5555
resultsDir: core.getInput('results-dir'),
5656
cacheDir: core.getInput('cache-dir'),
57-
primaryCacheKey: core.getInput('primary-cache-key'),
57+
primaryCacheKey:
58+
core.getInput('primary-cache-key') ||
59+
`qodana-${VERSION}-${process.env.GITHUB_REF}-${process.env.GITHUB_SHA}`,
5860
additionalCacheKey:
5961
core.getInput('additional-cache-key') ||
60-
core.getInput('additional-cache-hash'),
62+
core.getInput('additional-cache-hash') ||
63+
`qodana-${VERSION}-${process.env.GITHUB_REF}}-`,
6164
cacheDefaultBranchOnly: core.getBooleanInput('cache-default-branch-only'),
6265
uploadResult: core.getBooleanInput('upload-result'),
6366
uploadSarif: false, // not used by the action

0 commit comments

Comments
 (0)