-
Notifications
You must be signed in to change notification settings - Fork 36
Add action-mode: script feature flag for bash script execution #9763
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
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Add ActionModeScript constant and validation - Update generateCheckoutActionsFolder for script mode checkout - Create generateSetupStep helper for script vs action execution - Add feature flag override support in compiler - Update all setup step generation sites - Add tests for script mode validation Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Add TestScriptActionModeCompilation integration test - Verify script mode checkout behavior - Verify script execution instead of action usage - Add test files to gitignore Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
All tests passing for action mode script feature: - ActionMode validation tests ✅ - Script mode integration test ✅ - Manual compilation and verification ✅ - Code formatted and validated ✅ Feature successfully implements script mode that: - Checks out githubnext/gh-aw actions to /tmp/gh-aw/actions-source/ - Runs setup.sh script directly with INPUT_DESTINATION env var - Works via frontmatter feature flag or CLI --action-mode=script - Fully tested and documented Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot use the action-script mode to the dev.md agentic workflow. make this workflow print a poem to an issue (staged mode) |
- Enable script mode via features.action-mode flag - Workflow uses script mode to checkout and run setup.sh - Already configured for staged mode safe outputs - Posts poems to issues as comments (preview mode) Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done! Added The dev workflow now:
The compiled workflow shows: - name: Checkout actions source
uses: actions/checkout@...
with:
repository: githubnext/gh-aw
path: /tmp/gh-aw/actions-source
- name: Setup Scripts
run: |
bash /tmp/gh-aw/actions-source/actions/setup/setup.sh
env:
INPUT_DESTINATION: /opt/gh-aw/actions |
|
@copilot shallow checkout keep credentials false |
- Add depth: 1 to script mode checkout for faster cloning - Keep persist-credentials: false (already set) - Update test to verify shallow checkout parameter - Recompile dev.md workflow with shallow checkout Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done! Added shallow checkout with Script mode checkout now includes: - name: Checkout actions source
uses: actions/checkout@...
with:
repository: githubnext/gh-aw
sparse-checkout: |
actions
path: /tmp/gh-aw/actions-source
depth: 1 # ← shallow checkout
persist-credentials: false # ← credentials not persistedThis makes the checkout faster by only fetching the latest commit. |
|
@copilot recompile and make sure it uses the actions/setup from local path in compiled .lock.yml files (dev mode) |
- Remove action-mode: script feature flag from dev.md - Workflow now uses dev mode (default) with local actions/setup path - Compiled lock file uses 'uses: ./actions/setup' instead of bash script - Checkout uses local repository with sparse-checkout for actions folder - Tests pass successfully Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done! Reverted dev.md to use dev mode with local actions/setup in commit 1fe5ef5. The dev.lock.yml now uses: - name: Checkout actions folder
uses: actions/checkout@...
with:
sparse-checkout: |
actions
persist-credentials: false
- name: Setup Scripts
uses: ./actions/setup # ← local path
with:
destination: /opt/gh-aw/actionsRemoved the |
| success: ${{ steps.parse_results.outputs.success }} | ||
| steps: | ||
| - name: Checkout actions folder | ||
| - name: Checkout actions source |
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.
@copilot revert wording change "folder" -> "source". it's not needed.
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.
Done! Reverted the wording change in commit 528a137.
Both dev and script modes now use the same step name:
- name: Checkout actions folder # ← consistent namingThe unnecessary "source" → "folder" distinction has been removed.
- Changed script mode checkout step name from "Checkout actions source" back to "Checkout actions folder" - Both dev and script modes now use consistent "folder" naming - No functional changes, only step name consistency - Tests pass successfully Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Implements
action-mode: scriptfeature flag that runssetup.shfrom a checked-out.githubfolder instead of using GitHub Actions steps.Changes
ActionModeScriptconstant with validationgithubnext/gh-awactions to/tmp/gh-aw/actions-source/with shallow clone (depth: 1) for improved performancegenerateSetupStep()helper that runs bash script in script mode, action step otherwiseaction-modefrom frontmatter and overrides modeUsage
Via frontmatter:
Via CLI:
Script mode generates:
Dev mode (default) generates:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.