Skip to content

Commit b11edd9

Browse files
Merge pull request #2 from depot/rw-mount
Add check for /rw
2 parents 8c346c1 + f29a4ea commit b11edd9

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

dist/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22856,6 +22856,7 @@ function _getGlobal(key, defaultValue) {
2285622856
}
2285722857

2285822858
// src/index.ts
22859+
var fs3 = __toESM(require("node:fs"));
2285922860
var path5 = __toESM(require("node:path"));
2286022861
var client = new HttpClient("depot-snapshot-action");
2286122862
async function run() {
@@ -22868,6 +22869,11 @@ async function run() {
2286822869
setSecret(token);
2286922870
const snapshotPath = await group("Installing snapshot tool", () => installSnapshot(version));
2287022871
await exec(snapshotPath, ["--version"]);
22872+
await group("Preparing /rw", async () => {
22873+
if (fs3.existsSync("/rw")) return;
22874+
await exec("sudo", ["mkdir", "-p", "/rw"]);
22875+
await exec("sudo", ["mount", "/dev/vda", "/rw"]);
22876+
});
2287122877
await group("Creating snapshot", async () => {
2287222878
await exec(
2287322879
"sudo",

src/index.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import * as core from '@actions/core'
22
import * as exec from '@actions/exec'
33
import * as http from '@actions/http-client'
44
import * as toolCache from '@actions/tool-cache'
5+
import * as fs from 'node:fs'
56
import * as path from 'node:path'
67

78
type ApiResponse = {ok: true; url: string} | {ok: false; error: string}
@@ -21,6 +22,13 @@ async function run() {
2122
const snapshotPath = await core.group('Installing snapshot tool', () => installSnapshot(version))
2223
await exec.exec(snapshotPath, ['--version'])
2324

25+
await core.group('Preparing /rw', async () => {
26+
if (fs.existsSync('/rw')) return
27+
28+
await exec.exec('sudo', ['mkdir', '-p', '/rw'])
29+
await exec.exec('sudo', ['mount', '/dev/vda', '/rw'])
30+
})
31+
2432
await core.group('Creating snapshot', async () => {
2533
await exec.exec(
2634
'sudo',

0 commit comments

Comments
 (0)