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

Allow to disable caching completely #351

Merged
merged 6 commits into from
Feb 26, 2022
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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ jobs:
# Optional: show only new issues if it's a pull request. The default value is `false`.
# 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.
# skip-pkg-cache: true

Expand Down
6 changes: 6 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
default: false
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:
description: "if set to true then the action doesn't cache or restore ~/go/pkg."
default: false
Expand Down
4 changes: 4 additions & 0 deletions dist/post_run/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -65066,6 +65066,8 @@ function buildCacheKeys() {
}
function restoreCache() {
return __awaiter(this, void 0, void 0, function* () {
if (core.getInput(`skip-cache`, { required: true }).trim() == "true")
return;
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.`);
return;
Expand Down Expand Up @@ -65104,6 +65106,8 @@ function restoreCache() {
exports.restoreCache = restoreCache;
function saveCache() {
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
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.`);
Expand Down
4 changes: 4 additions & 0 deletions dist/run/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -65066,6 +65066,8 @@ function buildCacheKeys() {
}
function restoreCache() {
return __awaiter(this, void 0, void 0, function* () {
if (core.getInput(`skip-cache`, { required: true }).trim() == "true")
return;
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.`);
return;
Expand Down Expand Up @@ -65104,6 +65106,8 @@ function restoreCache() {
exports.restoreCache = restoreCache;
function saveCache() {
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
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.`);
Expand Down
4 changes: 4 additions & 0 deletions src/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ async function buildCacheKeys(): Promise<string[]> {
}

export async function restoreCache(): Promise<void> {
if (core.getInput(`skip-cache`, { required: true }).trim() == "true") return

if (!utils.isValidEvent()) {
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.`
Expand Down Expand Up @@ -112,6 +114,8 @@ export async function restoreCache(): 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
if (!utils.isValidEvent()) {
utils.logWarning(
Expand Down