From 255ffc154b60cfa742dfad38fde23425e4b2caac Mon Sep 17 00:00:00 2001 From: Yusuf Ali Date: Sat, 10 Jan 2026 02:34:21 +0000 Subject: [PATCH] ci: add in markdown embedder --- .github/workflows/agent-markdown.yml | 22 ++++++++++++++++++++++ .github/workflows/test.yml | 7 ++----- README.md | 2 ++ dist/index.js | 2 +- index.js | 4 ++-- 5 files changed, 29 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/agent-markdown.yml diff --git a/.github/workflows/agent-markdown.yml b/.github/workflows/agent-markdown.yml new file mode 100644 index 0000000..768a462 --- /dev/null +++ b/.github/workflows/agent-markdown.yml @@ -0,0 +1,22 @@ +name: Markdown Embedder +on: + workflow_dispatch: + push: + branches: + - main + paths: + - '**.md' + +jobs: + embed-markdown: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + + - name: Send task to coding agent + uses: git.yusufali.ca/automation/action@main + with: + api_url: ${{ secrets.AGENT_API_URL }} # default: https://api.servc.io + api_token: ${{ secrets.AGENT_TOKEN }} # optional, required for authenticated API calls + route: agent-lake # default: agent-lake + debug: false \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 44107b2..69a0f7f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,9 +1,7 @@ name: 'Unit Tests' on: pull_request: - push: - branches: - - main + workflow_dispatch: permissions: contents: read @@ -19,5 +17,4 @@ jobs: id: test uses: ./ with: - debug: 'true' - route: 'random' \ No newline at end of file + debug: 'true' \ No newline at end of file diff --git a/README.md b/README.md index 4685329..8f2b5e8 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,8 @@ on: push: branches: - main + paths: + - '**.md' jobs: embed-markdown: diff --git a/dist/index.js b/dist/index.js index da2072b..540e115 100644 --- a/dist/index.js +++ b/dist/index.js @@ -32907,7 +32907,7 @@ for (const file of markdownFiles) { `Agent API request failed (${response.status}): ${responseText}`, ); } else { - core.info(`Agent response: ${responseText}`); + core.info(`Agent response: ${response.text()}`); } }) .catch((error) => core.setFailed(`Error sending task to agent: ${error}`)); diff --git a/index.js b/index.js index c06ddf9..ea6305b 100644 --- a/index.js +++ b/index.js @@ -37,7 +37,7 @@ if (apiToken) { } for (const file of markdownFiles) { - const content = fs.readFileSync(file, "utf8"); + const content = fs.readFileSync(file, "utf8").trim(); const requestPayload = { type: "input", @@ -75,7 +75,7 @@ for (const file of markdownFiles) { `Agent API request failed (${response.status}): ${responseText}`, ); } else { - core.info(`Agent response: ${responseText}`); + core.info(`Agent response: ${response.text()}`); } }) .catch((error) => core.setFailed(`Error sending task to agent: ${error}`));