Files
medusa-store/www/utils/packages/scripts/get-generate-diff-message.ts
Shahed Nasser b39de05535 chore: move docs-util to www (#7232)
* reorganize docs apps

* add README

* fix directory

* add condition for old docs

* move docs-util to www

* remove remaining docs-util

* fixes of paths

* fix scripts

* path fixes

* fix github actions

* add build packages script
2024-05-06 09:13:50 +03:00

28 lines
714 B
TypeScript

import { execSync } from "child_process"
import * as core from "@actions/core"
const command = `git --no-pager diff --minimal --name-only ../../../apps/resources/references`
const diffOutput = execSync(command).toString()
const files = diffOutput.toString().split("\n").filter(Boolean)
const referenceNames: Set<string> = new Set([])
files.forEach((file) => {
const referenceName = file
.replace("www/apps/resources/references/", "")
.split("/")[0]
if (referenceName) {
referenceNames.add(referenceName)
}
})
let strOutput = "Generated the following references:\n"
referenceNames.forEach((referenceName) => {
strOutput += `- \`${referenceName}\`\n`
})
core.setOutput("body", strOutput)