|
1
|
import { execSync } from "child_process" |
|
2
|
import * as core from "@actions/core" |
|
3
|
|
|
4
|
const command = `git --no-pager diff --minimal --name-only ../../../apps/resources/references` |
|
5
|
const diffOutput = execSync(command).toString() |
|
6
|
|
|
7
|
const files = diffOutput.toString().split("\n").filter(Boolean) |
|
8
|
|
|
9
|
const referenceNames: Set<string> = new Set([]) |
|
10
|
|
|
11
|
files.forEach((file) => { |
|
12
|
const referenceName = file |
|
13
|
.replace("www/apps/resources/references/", "") |
|
14
|
.split("/")[0] |
|
15
|
|
|
16
|
if (referenceName) { |
|
17
|
referenceNames.add(referenceName) |
|
18
|
} |
|
19
|
}) |
|
20
|
|
|
21
|
let strOutput = "Generated the following references:\n" |
|
22
|
|
|
23
|
referenceNames.forEach((referenceName) => { |
|
24
|
strOutput += `- \`${referenceName}\`\n` |
|
25
|
}) |
|
26
|
|
|
27
|
core.setOutput("body", strOutput) |