-
Notifications
You must be signed in to change notification settings - Fork 248
CI: drop setup-command input from reusable community-world workflows #1828
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| --- | ||
| --- |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,11 +34,6 @@ on: | |
| required: false | ||
| type: string | ||
| default: 'none' | ||
| setup-command: | ||
| description: 'Setup command to run after installing the world package' | ||
| required: false | ||
| type: string | ||
| default: '' | ||
|
|
||
| jobs: | ||
| e2e: | ||
|
|
@@ -112,14 +107,18 @@ jobs: | |
| WORLD_PACKAGE: ${{ inputs.world-package }} | ||
| run: pnpm --filter "$APP_NAME" add "$WORLD_PACKAGE" | ||
|
|
||
| - name: Run setup command | ||
| if: ${{ inputs.setup-command != '' }} | ||
| # Per-world setup. Hardcoded (not taken from the matrix) so a malicious | ||
| # fork PR cannot smuggle arbitrary shell through matrix.world.setup-command. | ||
| - name: Per-world setup | ||
| env: | ||
|
Comment on lines
+110
to
113
|
||
| APP_NAME: ${{ inputs.app-name }} | ||
| SETUP_COMMAND: ${{ inputs.setup-command }} | ||
| WORLD_ID: ${{ inputs.world-id }} | ||
| run: | | ||
| cd "workbench/$APP_NAME" | ||
| eval "$SETUP_COMMAND" | ||
| case "$WORLD_ID" in | ||
| turso) pnpm exec workflow-turso-setup ;; | ||
| *) echo "No setup required for $WORLD_ID" ;; | ||
| esac | ||
|
|
||
| - name: Resolve symlinks | ||
| env: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The step name still implies an arbitrary command is executed, but the logic is now a fixed per-world switch. Consider renaming this step (e.g., "Per-world setup") and optionally adding an
ifso it only runs when the world actually needs setup, to reduce log noise for the common case.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed to 'Per-world setup' in 9cf6b2b. Skipping the optional if-guard since the default case just echoes and the per-world-id list already lives in one place (the case statement itself).