Skip to content

Commit 76c55df

Browse files
Short app name precaution
1 parent 44809e0 commit 76c55df

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

.github/workflows/test.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,27 @@ jobs:
4141
env:
4242
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
4343
API_KEY: ci-test-key
44-
# setting an $APP_NAME that will be unique even if folks choose to fork this repo --> avoids clashes.
45-
APP_NAME: mcp-${{ github.repository_owner }}-${{ github.event.repository.name }}-pr-${{ github.event.number }}
4644
# also note that github CI doesn't have access to your app's config vars, so here we're setting the remote
4745
# server type to streamable HTTP. Folks using SSE would need to change this line for their e2e remote integration
4846
# tests to test SSE instead of streamable HTTP.
4947
REMOTE_SERVER_TRANSPORT_MODULE: streamable_http_server
48+
# $APP_NAME is set below because we need to shorten the repo owner's name, as a precaution
5049

5150
steps:
5251
- uses: actions/checkout@v4
5352
with:
5453
fetch-depth: 0 # <-- disables shallow clone, which heroku is upset by when running git push heroku later on
5554

55+
# Setting a short $APP_NAME that will be unique even if folks choose to fork this repo --> avoids clashes.
56+
# Needs to be shortened if the github repo owner has a long name (max 30 char app name heroku limit).
57+
- name: Generate short APP_NAME
58+
id: appname
59+
run: |
60+
OWNER_SHORT=${GITHUB_REPOSITORY_OWNER:0:5}
61+
APP_NAME="${OWNER_SHORT}-${GITHUB_REPOSITORY}-${GITHUB_EVENT_NUMBER}"
62+
echo "APP_NAME=$APP_NAME"
63+
echo "APP_NAME=$APP_NAME" >> $GITHUB_ENV
64+
5665
- uses: actions/setup-python@v5
5766
with:
5867
python-version: "3.12" # this should align with this repo's .python-version file

0 commit comments

Comments
 (0)