-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathindex.mjs
More file actions
31 lines (25 loc) · 914 Bytes
/
Copy pathindex.mjs
File metadata and controls
31 lines (25 loc) · 914 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import path from "node:path";
import core from "@actions/core";
import { getConfig } from "@rnef/config";
import { nativeFingerprint } from "@rnef/tools";
const ALLOWED_PLATFORMS = ["android", "ios"];
async function run() {
const platform = core.getInput("platform");
const workingDirectory = core.getInput("working-directory");
if (!ALLOWED_PLATFORMS.includes(platform)) {
throw new Error(`Invalid platform: ${platform}`);
}
const dir = path.isAbsolute(workingDirectory)
? workingDirectory
: path.join(process.cwd(), workingDirectory);
const config = await getConfig(dir);
const fingerprintOptions = config.getFingerprintOptions();
const fingerprint = await nativeFingerprint(dir, {
platform,
...fingerprintOptions,
});
console.log("Hash:", fingerprint.hash);
console.log("Sources:", fingerprint.sources);
core.setOutput("hash", fingerprint.hash);
}
await run();