Skip to content
Merged
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
46 changes: 43 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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`
Expand Down Expand Up @@ -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: <BUMP_MCP_SERVER_ID_OR_SLUG>
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
Expand All @@ -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
Expand All @@ -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.
Expand All @@ -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).
2 changes: 2 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

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

5 changes: 5 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export async function run(): Promise<void> {
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
Expand Down Expand Up @@ -48,6 +49,10 @@ export async function run(): Promise<void> {
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());
Expand Down
15 changes: 15 additions & 0 deletions tests/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down