Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/forge-tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Forge tools

# Every six hours, regenerates src/generated/forge-mcp from the latest
# openapi.forge.json Forge release with the @cloudflare/forge package that
# package.json pins, a pkg.pr.new build of a forge commit.
# package.json pins, a published npm release.
# Its source.json pins the release the whole deployment serves: the forge
# tools, and the spec artifacts in src/generated/spec that the forge tools
# service serves to Code Mode and the endpoint tools. When the
Expand Down Expand Up @@ -36,12 +36,12 @@ jobs:
steps:
- uses: actions/checkout@v6

# The forge commit whose @cloudflare/forge build package.json pins, for the pull request.
# The @cloudflare/forge version package.json pins, for the pull request.
- name: Read the forge pin
id: forge
run: |
pin="$(jq -r '.devDependencies["@cloudflare/forge"]' package.json)"
echo "ref=${pin##*@}" >> "$GITHUB_OUTPUT"
version="$(jq -r '.devDependencies["@cloudflare/forge"]' package.json)"
echo "version=$version" >> "$GITHUB_OUTPUT"

- uses: actions/setup-node@v6
with:
Expand Down Expand Up @@ -75,7 +75,7 @@ jobs:
if: steps.changes.outputs.changed == 'true'
env:
GH_TOKEN: ${{ github.token }}
FORGE_REF: ${{ steps.forge.outputs.ref }}
FORGE_VERSION: ${{ steps.forge.outputs.version }}
run: |
git config user.name 'github-actions[bot]'
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
Expand All @@ -84,7 +84,7 @@ jobs:
git commit -q -m "$TITLE"
git push -q --force origin "$BRANCH"
{
echo "Pins the latest \`openapi.forge.json\` and regenerates the forge MCP tools with forge \`${FORGE_REF:0:12}\`. Merging deploys the new tools to \`/mcp?codemode=false\`, and within ten minutes Code Mode serves this spec too."
echo "Pins the latest \`openapi.forge.json\` and regenerates the forge MCP tools with forge \`$FORGE_VERSION\`. Merging deploys the new tools to \`/mcp?codemode=false\`, and within ten minutes Code Mode serves this spec too."
echo
cat "$RUNNER_TEMP/summary.md"
} > "$RUNNER_TEMP/body.md"
Expand Down
99 changes: 96 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"zod": "^4.6.6"
},
"devDependencies": {
"@cloudflare/forge": "https://pkg.pr.new/cloudflare/forge/@cloudflare/forge@f6720c19250f90fe5b395ef2c38d488aaba31641",
"@cloudflare/forge": "0.2.0",
"@cloudflare/vitest-plugin": "^1.4.9",
"@modelcontextprotocol/client": "2.3.1",
"@types/node": "^25.0.6",
Expand Down
4 changes: 2 additions & 2 deletions scripts/generate-tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* npm run generate:tools [-- --spec openapi.forge.json --release <tag>] [-- --summary summary.md]
*
* The forge that generates them is the `@cloudflare/forge` package in
* `package.json`, a pkg.pr.new build of a forge commit; bumping that pin picks
* up generator changes. `.github/workflows/forge-tools.yml` runs this every six
* `package.json`, a published npm release; bumping that pin picks up
* generator changes. `.github/workflows/forge-tools.yml` runs this every six
* hours and opens a pull request when the generated code changes. Without `--spec`, the latest `openapi.forge.json`
* Forge release is downloaded. `source.json` records the release, so a
* response that breaks a generated response schema names the spec it came
Expand Down