diff --git a/docs/src/components/PromptCode.astro b/docs/src/components/PromptCode.astro new file mode 100644 index 00000000000..a1daa783666 --- /dev/null +++ b/docs/src/components/PromptCode.astro @@ -0,0 +1,24 @@ +--- +import { readFileSync } from 'node:fs'; +import { resolve } from 'node:path'; +import { Code } from '@astrojs/starlight/components'; + +interface Props { + /** Path to the prompt markdown file, relative to `docs/src/`. */ + src: string; + /** URL that will be embedded in the first sentence of the prompt. */ + address: string; + /** Optional title shown as a header above the code block. */ + title?: string; +} + +const { src, address, title } = Astro.props; + +// process.cwd() is the docs project root during `astro build` / `astro dev` +const filePath = resolve(process.cwd(), 'src', src); +const fileContent = readFileSync(filePath, 'utf-8').trim(); + +const code = `Create an agentic workflow using the address ${address}\n\n${fileContent}`; +--- + + diff --git a/docs/src/content/docs/setup/creating-workflows.mdx b/docs/src/content/docs/setup/creating-workflows.mdx index 39560e02cb3..57942173bca 100644 --- a/docs/src/content/docs/setup/creating-workflows.mdx +++ b/docs/src/content/docs/setup/creating-workflows.mdx @@ -6,6 +6,7 @@ sidebar: --- import CopyEntireFileButton from '../../../components/CopyEntireFileButton.astro'; +import PromptCode from '../../../components/PromptCode.astro'; import Video from '../../../components/Video.astro'; **⏱️ Estimated time: 5-15 minutes** depending on complexity @@ -24,11 +25,10 @@ For a more fine grained, interactive experience we recommend using a coding agen Use this Agent Session task in your repository. -```markdown wrap -Create a workflow for GitHub Agentic Workflows using https://raw.githubusercontent.com/github/gh-aw/main/create.md - -The purpose of the workflow is triage issues. -``` +