MCPcopy Create free account
hub / github.com/github/gh-aw / run

Function run

actions/setup/src/index.js:13–43  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11};
12
13async function run() {
14 try {
15 const destination = core.getInput("destination") || "/tmp/gh-aw/actions/activation";
16
17 core.info(`Copying activation files to ${destination}`);
18
19 // Create destination directory with secure permissions if it doesn't exist
20 // Note: mode parameter is ignored on Windows; relies on default NTFS permissions
21 if (!fs.existsSync(destination)) {
22 fs.mkdirSync(destination, { recursive: true, mode: 0o700 });
23 core.info(`Created directory: ${destination}`);
24 }
25
26 let fileCount = 0;
27
28 // Copy each embedded file
29 for (const [filename, content] of Object.entries(FILES)) {
30 const filePath = path.join(destination, filename);
31 // Create file with secure permissions (readable/writable only by owner)
32 // Note: mode parameter is ignored on Windows; relies on default NTFS permissions
33 fs.writeFileSync(filePath, content, { encoding: "utf8", mode: 0o600 });
34 core.info(`Copied: ${filename}`);
35 fileCount++;
36 }
37
38 core.setOutput("files-copied", fileCount.toString());
39 core.info(`✓ Successfully copied ${fileCount} files`);
40 } catch (error) {
41 core.setFailed(`Action failed: ${error.message}`);
42 }
43}
44
45run();

Callers 3

index.jsFile · 0.70
index.jsFile · 0.50
post.jsFile · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected