mirror of
https://github.com/golangci/golangci-lint-action.git
synced 2025-12-15 23:26:31 +00:00
chore: generate
This commit is contained in:
parent
8c0f59df12
commit
3f9b554aae
2 changed files with 10 additions and 4 deletions
7
dist/post_run/index.js
generated
vendored
7
dist/post_run/index.js
generated
vendored
|
|
@ -88815,15 +88815,18 @@ const getLintCacheDir = () => {
|
||||||
};
|
};
|
||||||
const getIntervalKey = (invalidationIntervalDays) => {
|
const getIntervalKey = (invalidationIntervalDays) => {
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
|
if (invalidationIntervalDays <= 0) {
|
||||||
|
return `${now.getTime()}`;
|
||||||
|
}
|
||||||
const secondsSinceEpoch = now.getTime() / 1000;
|
const secondsSinceEpoch = now.getTime() / 1000;
|
||||||
const intervalNumber = Math.floor(secondsSinceEpoch / (invalidationIntervalDays * 86400));
|
const intervalNumber = Math.floor(secondsSinceEpoch / (invalidationIntervalDays * 86400));
|
||||||
return intervalNumber.toString();
|
return intervalNumber.toString();
|
||||||
};
|
};
|
||||||
async function buildCacheKeys() {
|
async function buildCacheKeys() {
|
||||||
const keys = [];
|
const keys = [];
|
||||||
|
const invalidationIntervalDays = parseInt(core.getInput(`cache-invalidation-interval`, { required: true }).trim());
|
||||||
// Periodically invalidate a cache because a new code being added.
|
// Periodically invalidate a cache because a new code being added.
|
||||||
// TODO: configure it via inputs.
|
let cacheKey = `golangci-lint.cache-${getIntervalKey(invalidationIntervalDays)}-`;
|
||||||
let cacheKey = `golangci-lint.cache-${getIntervalKey(7)}-`;
|
|
||||||
keys.push(cacheKey);
|
keys.push(cacheKey);
|
||||||
// Get working directory from input
|
// Get working directory from input
|
||||||
const workingDirectory = core.getInput(`working-directory`);
|
const workingDirectory = core.getInput(`working-directory`);
|
||||||
|
|
|
||||||
7
dist/run/index.js
generated
vendored
7
dist/run/index.js
generated
vendored
|
|
@ -88815,15 +88815,18 @@ const getLintCacheDir = () => {
|
||||||
};
|
};
|
||||||
const getIntervalKey = (invalidationIntervalDays) => {
|
const getIntervalKey = (invalidationIntervalDays) => {
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
|
if (invalidationIntervalDays <= 0) {
|
||||||
|
return `${now.getTime()}`;
|
||||||
|
}
|
||||||
const secondsSinceEpoch = now.getTime() / 1000;
|
const secondsSinceEpoch = now.getTime() / 1000;
|
||||||
const intervalNumber = Math.floor(secondsSinceEpoch / (invalidationIntervalDays * 86400));
|
const intervalNumber = Math.floor(secondsSinceEpoch / (invalidationIntervalDays * 86400));
|
||||||
return intervalNumber.toString();
|
return intervalNumber.toString();
|
||||||
};
|
};
|
||||||
async function buildCacheKeys() {
|
async function buildCacheKeys() {
|
||||||
const keys = [];
|
const keys = [];
|
||||||
|
const invalidationIntervalDays = parseInt(core.getInput(`cache-invalidation-interval`, { required: true }).trim());
|
||||||
// Periodically invalidate a cache because a new code being added.
|
// Periodically invalidate a cache because a new code being added.
|
||||||
// TODO: configure it via inputs.
|
let cacheKey = `golangci-lint.cache-${getIntervalKey(invalidationIntervalDays)}-`;
|
||||||
let cacheKey = `golangci-lint.cache-${getIntervalKey(7)}-`;
|
|
||||||
keys.push(cacheKey);
|
keys.push(cacheKey);
|
||||||
// Get working directory from input
|
// Get working directory from input
|
||||||
const workingDirectory = core.getInput(`working-directory`);
|
const workingDirectory = core.getInput(`working-directory`);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue