MCPcopy
hub / github.com/actions/cache / saveOnlyRun

Function saveOnlyRun

src/saveImpl.ts:81–108  ·  view source on GitHub ↗
(
    earlyExit?: boolean | undefined
)

Source from the content-addressed store, hash-verified

79}
80
81export async function saveOnlyRun(
82 earlyExit?: boolean | undefined
83): Promise<void> {
84 try {
85 const cacheId = await saveImpl(new NullStateProvider());
86 if (cacheId === -1) {
87 // The toolkit's saveCache already logs the underlying reason at
88 // the appropriate severity (warning for most failures, info for
89 // benign concurrency races, error for 5xx). Avoid emitting a
90 // generic warning here that would duplicate or mask that signal.
91 core.debug(`Cache was not saved.`);
92 }
93 } catch (err) {
94 console.error(err);
95 if (earlyExit) {
96 process.exit(1);
97 }
98 }
99
100 // node will stay alive if any promises are not resolved,
101 // which is a possibility if HTTP requests are dangling
102 // due to retries or timeouts. We know that if we got here
103 // that all promises that we care about have successfully
104 // resolved, so simply exit with success.
105 if (earlyExit) {
106 process.exit(0);
107 }
108}
109
110export async function saveRun(earlyExit?: boolean | undefined): Promise<void> {
111 try {

Callers 2

saveOnly.tsFile · 0.90
saveOnly.test.tsFile · 0.85

Calls 1

saveImplFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…