feat: Add workflow_dispatch event with script parameters and update trace output to GITHUB_STEP_SUMMARY #1821
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR enhances the GitHub Action template generation to include
workflow_dispatch
events with script parameters as inputs and updates the trace output to use$GITHUB_STEP_SUMMARY
.Changes Made
1. Added workflow_dispatch Event with Script Parameters
The generated workflow templates now include a
workflow_dispatch
trigger alongside the original event (push, pull_request, etc.), allowing users to manually trigger actions with custom inputs:2. Updated Trace Output to GITHUB_STEP_SUMMARY
Changed the start command in
package.json
from--out-output
to--out-trace
to properly send trace output to GitHub's step summary:3. Enhanced Workflow Step to Use Dispatch Inputs
The action step now conditionally uses workflow_dispatch inputs when the workflow is manually triggered:
Security Considerations
The implementation excludes sensitive configuration inputs (API keys, endpoints, credentials) from workflow_dispatch inputs for security, while still including them as commented examples in the workflow template.
Testing
script({ parameters: {...} })
$GITHUB_STEP_SUMMARY
This enhancement allows users to manually trigger GenAIScript actions with custom parameters while maintaining the existing automated trigger functionality.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
cdn.sheetjs.com
node /home/REDACTED/.local/share/pnpm/.tools/pnpm/10.12.3/bin/pnpm install --frozen-lockfile
(dns block)esm.ubuntu.com
/usr/lib/apt/methods/https
(dns block)node /home/REDACTED/.local/share/pnpm/.tools/pnpm/10.12.3/bin/pnpm install --frozen-lockfile
(dns block)https://api.github.com/markdown
node (vitest 3)
(http block)https://api.github.com/repos/microsoft/genaiscript/branches
node (vitest 3)
(http block)https://api.github.com/repos/microsoft/genaiscript/contents/README.md
node (vitest 3)
(http block)https://api.github.com/repos/microsoft/genaiscript/contents/packages%2Fcore%2Fsrc
node (vitest 3)
(http block)https://api.github.com/repos/microsoft/genaiscript/git/blobs
node (vitest 3)
(http block)https://api.github.com/repos/microsoft/genaiscript/git/ref/heads%2Ftest-ignore
node (vitest 3)
(http block)https://api.github.com/repos/microsoft/genaiscript/issues
node (vitest 3)
(http block)https://api.github.com/repos/microsoft/genaiscript/labels
node (vitest 3)
(http block)https://api.github.com/repos/microsoft/genaiscript/languages
node (vitest 3)
(http block)https://api.github.com/repos/microsoft/genaiscript/pulls
node (vitest 3)
(http block)https://api.github.com/repos/microsoft/genaiscript/pulls/999999
node (vitest 3)
(http block)microsoft.github.io
node (vitest 2)
(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.