Skip to content
Merged
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
19 changes: 15 additions & 4 deletions .github/workflows/docker-mcp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,34 @@ name: Docker MCP Server
on:
release:
types: [published]
workflow_dispatch:
inputs:
version:
description: 'MCP server version to build (e.g. 0.3.8)'
required: true

jobs:
docker:
name: Build and push MCP server image
if: startsWith(github.event.release.tag_name, '@transloadit/mcp-server@')
if: >-
github.event_name == 'workflow_dispatch' ||
startsWith(github.event.release.tag_name, '@transloadit/mcp-server@')
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4

- name: Extract version from release tag
- name: Extract version
id: version
run: |
TAG="${{ github.event.release.tag_name }}"
VERSION="${TAG#@transloadit/mcp-server@}"
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
VERSION="${{ github.event.inputs.version }}"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Bind manual image tag to the code ref being built

For workflow_dispatch, the version is taken verbatim from ${{ github.event.inputs.version }} here, but the job still builds whatever ref was dispatched (typically main via actions/checkout@v4). That means triggering this workflow after main has advanced (or entering an older version) can publish a mismatched image under that semver tag (and latest), which can ship incorrect code to users. The manual path should derive the tag from the checked-out source or explicitly check out the release tag that matches the requested version.

Useful? React with 👍 / 👎.

else
TAG="${{ github.event.release.tag_name }}"
VERSION="${TAG#@transloadit/mcp-server@}"
fi
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"

- uses: docker/setup-buildx-action@v3
Expand Down