mirror of
https://gitee.com/actions-mirror/cache.git
synced 2024-11-27 13:00:42 +08:00
Use warning instead of info
This commit is contained in:
parent
55a5894438
commit
d3e4f218f3
@ -58,7 +58,7 @@ test("restore with invalid event outputs warning", async () => {
|
|||||||
test("restore on GHES should no-op", async () => {
|
test("restore on GHES should no-op", async () => {
|
||||||
jest.spyOn(actionUtils, "isGhes").mockImplementation(() => true);
|
jest.spyOn(actionUtils, "isGhes").mockImplementation(() => true);
|
||||||
|
|
||||||
const infoMock = jest.spyOn(core, "info");
|
const logWarningMock = jest.spyOn(actionUtils, "logWarning");
|
||||||
const restoreCacheMock = jest.spyOn(cache, "restoreCache");
|
const restoreCacheMock = jest.spyOn(cache, "restoreCache");
|
||||||
const setCacheHitOutputMock = jest.spyOn(actionUtils, "setCacheHitOutput");
|
const setCacheHitOutputMock = jest.spyOn(actionUtils, "setCacheHitOutput");
|
||||||
|
|
||||||
@ -67,7 +67,7 @@ test("restore on GHES should no-op", async () => {
|
|||||||
expect(restoreCacheMock).toHaveBeenCalledTimes(0);
|
expect(restoreCacheMock).toHaveBeenCalledTimes(0);
|
||||||
expect(setCacheHitOutputMock).toHaveBeenCalledTimes(1);
|
expect(setCacheHitOutputMock).toHaveBeenCalledTimes(1);
|
||||||
expect(setCacheHitOutputMock).toHaveBeenCalledWith(false);
|
expect(setCacheHitOutputMock).toHaveBeenCalledWith(false);
|
||||||
expect(infoMock).toHaveBeenCalledWith(
|
expect(logWarningMock).toHaveBeenCalledWith(
|
||||||
"Cache action is not supported on GHES"
|
"Cache action is not supported on GHES"
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
@ -96,13 +96,13 @@ test("save with no primary key in state outputs warning", async () => {
|
|||||||
test("save on GHES should no-op", async () => {
|
test("save on GHES should no-op", async () => {
|
||||||
jest.spyOn(actionUtils, "isGhes").mockImplementation(() => true);
|
jest.spyOn(actionUtils, "isGhes").mockImplementation(() => true);
|
||||||
|
|
||||||
const infoMock = jest.spyOn(core, "info");
|
const logWarningMock = jest.spyOn(actionUtils, "logWarning");
|
||||||
const saveCacheMock = jest.spyOn(cache, "saveCache");
|
const saveCacheMock = jest.spyOn(cache, "saveCache");
|
||||||
|
|
||||||
await run();
|
await run();
|
||||||
|
|
||||||
expect(saveCacheMock).toHaveBeenCalledTimes(0);
|
expect(saveCacheMock).toHaveBeenCalledTimes(0);
|
||||||
expect(infoMock).toHaveBeenCalledWith(
|
expect(logWarningMock).toHaveBeenCalledWith(
|
||||||
"Cache action is not supported on GHES"
|
"Cache action is not supported on GHES"
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
2
dist/restore/index.js
vendored
2
dist/restore/index.js
vendored
@ -39995,7 +39995,7 @@ function run() {
|
|||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
try {
|
try {
|
||||||
if (utils.isGhes()) {
|
if (utils.isGhes()) {
|
||||||
core.info("Cache action is not supported on GHES");
|
utils.logWarning("Cache action is not supported on GHES");
|
||||||
utils.setCacheHitOutput(false);
|
utils.setCacheHitOutput(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
2
dist/save/index.js
vendored
2
dist/save/index.js
vendored
@ -38331,7 +38331,7 @@ function run() {
|
|||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
try {
|
try {
|
||||||
if (utils.isGhes()) {
|
if (utils.isGhes()) {
|
||||||
core.info("Cache action is not supported on GHES");
|
utils.logWarning("Cache action is not supported on GHES");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!utils.isValidEvent()) {
|
if (!utils.isValidEvent()) {
|
||||||
|
@ -7,7 +7,7 @@ import * as utils from "./utils/actionUtils";
|
|||||||
async function run(): Promise<void> {
|
async function run(): Promise<void> {
|
||||||
try {
|
try {
|
||||||
if (utils.isGhes()) {
|
if (utils.isGhes()) {
|
||||||
core.info("Cache action is not supported on GHES");
|
utils.logWarning("Cache action is not supported on GHES");
|
||||||
utils.setCacheHitOutput(false);
|
utils.setCacheHitOutput(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@ import * as utils from "./utils/actionUtils";
|
|||||||
async function run(): Promise<void> {
|
async function run(): Promise<void> {
|
||||||
try {
|
try {
|
||||||
if (utils.isGhes()) {
|
if (utils.isGhes()) {
|
||||||
core.info("Cache action is not supported on GHES");
|
utils.logWarning("Cache action is not supported on GHES");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user