From 8cd9eca08bfa64f4337fcc19dcaaa90ff3fa4bd5 Mon Sep 17 00:00:00 2001 From: Polo M2B Date: Fri, 13 Feb 2026 16:53:00 +0100 Subject: [PATCH] New mcp_server action for .github/workflows/bump.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit => On GitHub action, use keyword mcp_server ``` with: command: deploy mcp_server: token: ${{secrets.BUMP_TOKEN}} file: doc/flower-document.yml ``` => New command transmitted to bump-cli: `bump deploy --mcp_server mcp_server_id_or_slug doc/flower-document.yml` => New request sent to Bump.sh API: `POST /api/v1/mcp_servers/{mcp_server_id_or_slug}/deploy` the GitHub action should be used to deploy a workflow document on Bump.sh API ✨ --- README.md | 46 +++++++++++++++++++++++++++++++++++++++++++--- action.yml | 2 ++ package-lock.json | 2 +- src/main.ts | 5 +++++ tests/main.test.ts | 15 +++++++++++++++ 5 files changed, 66 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a3a37b21..612717d4 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,10 @@ Then you can pick from one of the three following API workflow files. - [Deploy documentation only](#deploy-documentation-only) - [Diff on pull requests only](#diff-on-pull-requests-only) +This GitHub action can be utilized to interact with the MCP server and workflow definition on bump.sh hosted on Bump.sh: + +- [Deploy workflow document for your MCP server](#deploy-workflow-document-for-your-MCP-Server) + ### Deploy documentation & diff on pull requests This is the most common worklow that we [recommend using](https://docs.bump.sh/help/continuous-integration/), which will create two steps in your automation flow: a validation & diff step on code reviews, followed by a deployment step on merged changes. @@ -161,7 +165,7 @@ jobs: ### Deploy a single documentation on a hub -You can deploy a documentation inside a hub by adding a `hub` slug or id. +You can deploy a documentation inside a hub by adding a `hub` slug or id. Note that the documentation will be automatically created if it doesn't exist by using the slug you defined with the `doc:` input. `.github/workflows/bump.yml` @@ -254,6 +258,40 @@ In order to deploy the 3 services API definition files from this folder (`privat filename_pattern: '*-api-{slug}-service' ``` +### Deploy workflow document for your MCP server + +You'll need to get the slug (or id) of your MCP Server, +accessible on bump.sh: https://bump.sh/{your-organization}/workflow/set/{mcp-server-id}/tokens + +Copy the slug (we can call it BUMP_MCP_SERVER_ID_OR_SLUG) and use it with command deploy, +with link to your flower specification: + +`.github/workflows/bump.yml` + +```yaml +name: Deploy workflow document for your MCP server + +on: + push: + branches: + - main + +jobs: + deploy-workflow-document: + name: Deploy workflow document for MCP server on Bump.sh + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Deploy workflow document + uses: bump-sh/github-action@v1 + with: + command: deploy + mcp_server: + token: ${{secrets.BUMP_TOKEN}} + file: doc/flower-document.yml +``` + ## Inputs * `doc` (required unless you deploy a directory on a hub): Documentation slug or id. Can be found in the documentation settings on https://bump.sh/dashboard @@ -274,7 +312,7 @@ In order to deploy the 3 services API definition files from this folder (`privat * `command`: Bump.sh command to execute. _Default: `deploy`_ - * `deploy`: deploy a new version of the documentation + * `deploy`: deploy a new version of the documentation (or MCP Server ✨) * `diff`: automatically comment your pull request with the API diff * `dry-run`: dry-run a deployment of the documentation file * `preview`: create a temporary preview @@ -283,6 +321,8 @@ In order to deploy the 3 services API definition files from this folder (`privat * `fail_on_breaking` (optional): Mark the action as failed when a breaking change is detected with the diff command. This is only valid with `diff` command. +* `mcp_server` (required to deploy workflow document on MCP server): MCP Server id or slug. Can be found MCP Server settings: https://bump.sh/{your-organization}/workflow/set/{mcp-server-id}/tokens. This is only valid with the `deploy` command (default command). + ## Contributing Bug reports and pull requests are welcome on GitHub at https://github.com/bump-sh/github-action. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct. @@ -293,4 +333,4 @@ The scripts and documentation in this project are released under the [MIT Licens ## Code of Conduct -Everyone interacting in the Bump `github-action` project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/bump-sh/github-action/blob/master/CODE_OF_CONDUCT.md). +Everyone interacting in the Bump.sh `github-action` project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/bump-sh/github-action/blob/master/CODE_OF_CONDUCT.md). diff --git a/action.yml b/action.yml index 04902eed..52958a5e 100644 --- a/action.yml +++ b/action.yml @@ -29,6 +29,8 @@ inputs: filename_pattern: default: "{slug}-api" description: "Filename pattern to extract the documentation slug from filenames when deploying a DIRECTORY. Pattern uses only '*' and '{slug}' as special characters to extract the slug from a filename without extension. Only used with the 'hub' input when deploying a whole directory ." + mcp_server: + description: "MCP Server id or slug. Necessary to deploy a new workflow documentation to be run by your MCP Server." runs: using: node20 main: dist/index.js diff --git a/package-lock.json b/package-lock.json index a3deff33..28395a31 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,7 @@ "@actions/github": "^5.1.1", "@actions/io": "^1.1.3", "@octokit/types": "^14.1.0", - "bump-cli": "^2.9.9" + "bump-cli": "^2.9.10" }, "devDependencies": { "@github/local-action": "^5.1.0", diff --git a/src/main.ts b/src/main.ts index 6086dd52..70651ce1 100644 --- a/src/main.ts +++ b/src/main.ts @@ -21,6 +21,7 @@ export async function run(): Promise { const expires: string | undefined = core.getInput('expires'); const failOnBreaking: boolean = core.getInput('fail_on_breaking') === 'true'; const filenamePattern: string = core.getInput('filename_pattern'); + const mcpServer: string = core.getInput('mcp_server'); const cliParams = [file]; // HELP: this condition on the import meta dirname is here only @@ -48,6 +49,10 @@ export async function run(): Promise { deployParams = deployParams.concat(processOverlays(overlays)); } + if (mcpServer) { + deployParams = deployParams.concat(['--mcp-server', mcpServer]); + } + // debug is only output if you set the secret `ACTIONS_RUNNER_DEBUG` to true core.debug(`Waiting for bump ${command} ...`); core.debug(new Date().toTimeString()); diff --git a/tests/main.test.ts b/tests/main.test.ts index d3c74712..b86a843f 100644 --- a/tests/main.test.ts +++ b/tests/main.test.ts @@ -243,6 +243,21 @@ describe('main.ts', () => { ); expect(core.setFailed).not.toHaveBeenCalled(); }); + + it('test action run deploy with mcp server correctly', async () => { + mockInputs({ + file: 'my-flower-file.yml', + mcp_server: 'wooow-shamrock', + token: 'SECRET', + }); + + await run(); + + expect(bump.Deploy.run).toHaveBeenCalledWith( + ['my-flower-file.yml', '--token', 'SECRET', '--mcp-server', 'wooow-shamrock'], + '.', + ); + }); }); describe('preview command', () => {