Allow to disable caching completely (#351)
* Add skip-cache parameter * Update README * Implement cache skipping * Run prettier * update descriptions * re-build dist Co-authored-by: Sergey Vilgelm <sergey@vilgelm.com>
This commit is contained in:
parent
7d5614c3eb
commit
cdfc708aeb
@ -55,6 +55,10 @@ jobs:
|
|||||||
# Optional: show only new issues if it's a pull request. The default value is `false`.
|
# Optional: show only new issues if it's a pull request. The default value is `false`.
|
||||||
# only-new-issues: true
|
# only-new-issues: true
|
||||||
|
|
||||||
|
# Optional: if set to true then the all caching functionality will be complete disabled,
|
||||||
|
# takes precedence over all other caching options.
|
||||||
|
# skip-cache: true
|
||||||
|
|
||||||
# Optional: if set to true then the action don't cache or restore ~/go/pkg.
|
# Optional: if set to true then the action don't cache or restore ~/go/pkg.
|
||||||
# skip-pkg-cache: true
|
# skip-pkg-cache: true
|
||||||
|
|
||||||
|
@ -20,6 +20,12 @@ inputs:
|
|||||||
description: "if set to true and the action runs on a pull request - the action outputs only newly found issues"
|
description: "if set to true and the action runs on a pull request - the action outputs only newly found issues"
|
||||||
default: false
|
default: false
|
||||||
required: true
|
required: true
|
||||||
|
skip-cache:
|
||||||
|
description: |
|
||||||
|
if set to true then the all caching functionality will be complete disabled,
|
||||||
|
takes precedence over all other caching options.
|
||||||
|
default: false
|
||||||
|
required: true
|
||||||
skip-pkg-cache:
|
skip-pkg-cache:
|
||||||
description: "if set to true then the action doesn't cache or restore ~/go/pkg."
|
description: "if set to true then the action doesn't cache or restore ~/go/pkg."
|
||||||
default: false
|
default: false
|
||||||
|
4
dist/post_run/index.js
vendored
4
dist/post_run/index.js
vendored
@ -65066,6 +65066,8 @@ function buildCacheKeys() {
|
|||||||
}
|
}
|
||||||
function restoreCache() {
|
function restoreCache() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
if (core.getInput(`skip-cache`, { required: true }).trim() == "true")
|
||||||
|
return;
|
||||||
if (!utils.isValidEvent()) {
|
if (!utils.isValidEvent()) {
|
||||||
utils.logWarning(`Event Validation Error: The event type ${process.env[constants_1.Events.Key]} is not supported because it's not tied to a branch or tag ref.`);
|
utils.logWarning(`Event Validation Error: The event type ${process.env[constants_1.Events.Key]} is not supported because it's not tied to a branch or tag ref.`);
|
||||||
return;
|
return;
|
||||||
@ -65104,6 +65106,8 @@ function restoreCache() {
|
|||||||
exports.restoreCache = restoreCache;
|
exports.restoreCache = restoreCache;
|
||||||
function saveCache() {
|
function saveCache() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
if (core.getInput(`skip-cache`, { required: true }).trim() == "true")
|
||||||
|
return;
|
||||||
// Validate inputs, this can cause task failure
|
// Validate inputs, this can cause task failure
|
||||||
if (!utils.isValidEvent()) {
|
if (!utils.isValidEvent()) {
|
||||||
utils.logWarning(`Event Validation Error: The event type ${process.env[constants_1.Events.Key]} is not supported because it's not tied to a branch or tag ref.`);
|
utils.logWarning(`Event Validation Error: The event type ${process.env[constants_1.Events.Key]} is not supported because it's not tied to a branch or tag ref.`);
|
||||||
|
4
dist/run/index.js
vendored
4
dist/run/index.js
vendored
@ -65066,6 +65066,8 @@ function buildCacheKeys() {
|
|||||||
}
|
}
|
||||||
function restoreCache() {
|
function restoreCache() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
if (core.getInput(`skip-cache`, { required: true }).trim() == "true")
|
||||||
|
return;
|
||||||
if (!utils.isValidEvent()) {
|
if (!utils.isValidEvent()) {
|
||||||
utils.logWarning(`Event Validation Error: The event type ${process.env[constants_1.Events.Key]} is not supported because it's not tied to a branch or tag ref.`);
|
utils.logWarning(`Event Validation Error: The event type ${process.env[constants_1.Events.Key]} is not supported because it's not tied to a branch or tag ref.`);
|
||||||
return;
|
return;
|
||||||
@ -65104,6 +65106,8 @@ function restoreCache() {
|
|||||||
exports.restoreCache = restoreCache;
|
exports.restoreCache = restoreCache;
|
||||||
function saveCache() {
|
function saveCache() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
if (core.getInput(`skip-cache`, { required: true }).trim() == "true")
|
||||||
|
return;
|
||||||
// Validate inputs, this can cause task failure
|
// Validate inputs, this can cause task failure
|
||||||
if (!utils.isValidEvent()) {
|
if (!utils.isValidEvent()) {
|
||||||
utils.logWarning(`Event Validation Error: The event type ${process.env[constants_1.Events.Key]} is not supported because it's not tied to a branch or tag ref.`);
|
utils.logWarning(`Event Validation Error: The event type ${process.env[constants_1.Events.Key]} is not supported because it's not tied to a branch or tag ref.`);
|
||||||
|
@ -72,6 +72,8 @@ async function buildCacheKeys(): Promise<string[]> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function restoreCache(): Promise<void> {
|
export async function restoreCache(): Promise<void> {
|
||||||
|
if (core.getInput(`skip-cache`, { required: true }).trim() == "true") return
|
||||||
|
|
||||||
if (!utils.isValidEvent()) {
|
if (!utils.isValidEvent()) {
|
||||||
utils.logWarning(
|
utils.logWarning(
|
||||||
`Event Validation Error: The event type ${process.env[Events.Key]} is not supported because it's not tied to a branch or tag ref.`
|
`Event Validation Error: The event type ${process.env[Events.Key]} is not supported because it's not tied to a branch or tag ref.`
|
||||||
@ -112,6 +114,8 @@ export async function restoreCache(): Promise<void> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function saveCache(): Promise<void> {
|
export async function saveCache(): Promise<void> {
|
||||||
|
if (core.getInput(`skip-cache`, { required: true }).trim() == "true") return
|
||||||
|
|
||||||
// Validate inputs, this can cause task failure
|
// Validate inputs, this can cause task failure
|
||||||
if (!utils.isValidEvent()) {
|
if (!utils.isValidEvent()) {
|
||||||
utils.logWarning(
|
utils.logWarning(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user