Skip to content

Commit aeb9c90

Browse files
committed
New mcp_server action for .github/workflows/bump.yml
=> On GitHub action, use keyword mcp_server ``` with: command: deploy mcp_server: <BUMP_MCP_SERVER_ID_OR_SLUG> 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 ✨
1 parent f5861ea commit aeb9c90

5 files changed

Lines changed: 66 additions & 4 deletions

File tree

README.md

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ Then you can pick from one of the three following API workflow files.
3333
- [Deploy documentation only](#deploy-documentation-only)
3434
- [Diff on pull requests only](#diff-on-pull-requests-only)
3535

36+
This GitHub action can be utilized to interact with the MCP server and workflow definition on bump.sh hosted on Bump.sh:
37+
38+
- [Deploy workflow document for your MCP server](#deploy-workflow-document-for-your-MCP-Server)
39+
3640
### Deploy documentation & diff on pull requests
3741

3842
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:
161165

162166
### Deploy a single documentation on a hub
163167

164-
You can deploy a documentation inside a hub by adding a `hub` slug or id.
168+
You can deploy a documentation inside a hub by adding a `hub` slug or id.
165169
Note that the documentation will be automatically created if it doesn't exist by using the slug you defined with the `doc:` input.
166170

167171
`.github/workflows/bump.yml`
@@ -254,6 +258,40 @@ In order to deploy the 3 services API definition files from this folder (`privat
254258
filename_pattern: '*-api-{slug}-service'
255259
```
256260

261+
### Deploy workflow document for your MCP server
262+
263+
You'll need to get the slug (or id) of your MCP Server,
264+
accessible on bump.sh: https://bump.sh/{your-organization}/workflow/set/{mcp-server-id}/tokens
265+
266+
Copy the slug (we can call it BUMP_MCP_SERVER_ID_OR_SLUG) and use it with command deploy,
267+
with link to your flower specification:
268+
269+
`.github/workflows/bump.yml`
270+
271+
```yaml
272+
name: Deploy workflow document for your MCP server
273+
274+
on:
275+
push:
276+
branches:
277+
- main
278+
279+
jobs:
280+
deploy-workflow-document:
281+
name: Deploy workflow document for MCP server on Bump.sh
282+
runs-on: ubuntu-latest
283+
steps:
284+
- name: Checkout
285+
uses: actions/checkout@v4
286+
- name: Deploy workflow document
287+
uses: bump-sh/github-action@v1
288+
with:
289+
command: deploy
290+
mcp_server: <BUMP_MCP_SERVER_ID_OR_SLUG>
291+
token: ${{secrets.BUMP_TOKEN}}
292+
file: doc/flower-document.yml
293+
```
294+
257295
## Inputs
258296

259297
* `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
274312

275313
* `command`: Bump.sh command to execute. _Default: `deploy`_
276314

277-
* `deploy`: deploy a new version of the documentation
315+
* `deploy`: deploy a new version of the documentation (or MCP Server ✨)
278316
* `diff`: automatically comment your pull request with the API diff
279317
* `dry-run`: dry-run a deployment of the documentation file
280318
* `preview`: create a temporary preview
@@ -283,6 +321,8 @@ In order to deploy the 3 services API definition files from this folder (`privat
283321

284322
* `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.
285323

324+
* `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).
325+
286326
## Contributing
287327

288328
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
293333

294334
## Code of Conduct
295335

296-
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).
336+
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).

action.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ inputs:
2929
filename_pattern:
3030
default: "{slug}-api"
3131
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 ."
32+
mcp_server:
33+
description: "MCP Server id or slug. Necessary to deploy a new workflow documentation to be run by your MCP Server."
3234
runs:
3335
using: node20
3436
main: dist/index.js

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export async function run(): Promise<void> {
2121
const expires: string | undefined = core.getInput('expires');
2222
const failOnBreaking: boolean = core.getInput('fail_on_breaking') === 'true';
2323
const filenamePattern: string = core.getInput('filename_pattern');
24+
const mcpServer: string = core.getInput('mcp_server');
2425
const cliParams = [file];
2526

2627
// HELP: this condition on the import meta dirname is here only
@@ -48,6 +49,10 @@ export async function run(): Promise<void> {
4849
deployParams = deployParams.concat(processOverlays(overlays));
4950
}
5051

52+
if (mcpServer) {
53+
deployParams = deployParams.concat(['--mcp-server', mcpServer]);
54+
}
55+
5156
// debug is only output if you set the secret `ACTIONS_RUNNER_DEBUG` to true
5257
core.debug(`Waiting for bump ${command} ...`);
5358
core.debug(new Date().toTimeString());

tests/main.test.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,21 @@ describe('main.ts', () => {
243243
);
244244
expect(core.setFailed).not.toHaveBeenCalled();
245245
});
246+
247+
it('test action run deploy with mcp server correctly', async () => {
248+
mockInputs({
249+
file: 'my-flower-file.yml',
250+
mcp_server: 'wooow-shamrock',
251+
token: 'SECRET',
252+
});
253+
254+
await run();
255+
256+
expect(bump.Deploy.run).toHaveBeenCalledWith(
257+
['my-flower-file.yml', '--token', 'SECRET', '--mcp-server', 'wooow-shamrock'],
258+
'.',
259+
);
260+
});
246261
});
247262

248263
describe('preview command', () => {

0 commit comments

Comments
 (0)