Make actions/setup/ the source of truth for both shell and JavaScript files#7582
Merged
Make actions/setup/ the source of truth for both shell and JavaScript files#7582
Conversation
- Add sync-shell-scripts Makefile target to copy from actions/setup/sh/ to pkg/workflow/sh/ - Update build target to run sync-shell-scripts before building binary - Update buildSetupAction to NOT copy shell scripts (they already exist in actions/setup/sh/) - Update ActionsCleanCommand to NOT remove sh/ directory (it's source of truth) - Mark pkg/workflow/sh/*.sh as linguist-generated in .gitattributes - Update AGENTS.md and specs/actions.md with new sync pattern documentation - Add Makefile help text for sync-shell-scripts target Shell scripts now follow the pattern: actions/setup/sh/*.sh (source) → pkg/workflow/sh/*.sh (generated) → embedded in binary Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Make setup js files the source of truth
Make actions/setup/sh the source of truth for shell scripts
Dec 25, 2025
Contributor
|
@copilot also source of truth for JavaScript scripts |
Add JavaScript File Sync section to clarify that JavaScript files follow the OPPOSITE pattern from shell scripts: - Shell: actions/setup/sh/ (source) → pkg/workflow/sh/ (generated) - JavaScript: pkg/workflow/js/ (source) → actions/setup/js/ (generated) Both have generated files in actions/setup/, but from different source directories. Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Contributor
Author
Added JavaScript File Sync section to AGENTS.md documenting both patterns in commit 67a702c:
Both have generated files in |
Contributor
|
@copilot make actions/setup/js also the source of truth for JavaScript scripts |
Reverse JavaScript sync direction to match shell scripts pattern: - Add sync-js-scripts Makefile target to copy from actions/setup/js/ to pkg/workflow/js/ - Update build target to run sync-js-scripts before building binary - Update buildSetupAction to NOT copy JavaScript files (they're now source of truth) - Update ActionsCleanCommand to NOT remove js/ directory from actions/setup - Mark pkg/workflow/js/*.cjs as linguist-generated in .gitattributes - Remove linguist-generated marking from actions/setup/js/*.cjs - Update AGENTS.md and specs/actions.md documentation Both JavaScript and shell scripts now follow the same pattern: - Shell: actions/setup/sh/ (source) → pkg/workflow/sh/ (generated) - JavaScript: actions/setup/js/ (source) → pkg/workflow/js/ (generated) Test files (*.test.cjs) remain only in pkg/workflow/js/ and are not synced. Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Contributor
Author
Done in commit 29e2fca. Both JavaScript and shell scripts now follow the same pattern:
Both are synced to |
Copilot
AI
changed the title
Make actions/setup/sh the source of truth for shell scripts
Make actions/setup/ the source of truth for both shell and JavaScript files
Dec 25, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Make actions/setup/ the source of truth for both shell and JavaScript files
This PR reverses the sync direction for both shell scripts and JavaScript files, making
actions/setup/the source of truth for both file types that get copied topkg/workflow/(not the other way around).Plan
//go:embedfrompkg/workflow/sh///go:embedfrompkg/workflow/js/actions/setup/populated bybuildSetupActionfunctionpkg/workflow/→actions/setup/actions/setup/sh/→pkg/workflow/sh/buildSetupActionto NOT copy shell scriptsactions/setup/js/→pkg/workflow/js/buildSetupActionto NOT copy JavaScript filespkg/workflow/sh/*.shaslinguist-generatedpkg/workflow/js/*.cjsaslinguist-generatedactions/setup/sh/*.shandactions/setup/js/*.cjsare NOT marked as generatedChanges Made
Makefile:
sync-shell-scriptstarget that copiesactions/setup/sh/*.sh→pkg/workflow/sh/sync-js-scriptstarget that copiesactions/setup/js/*.cjs→pkg/workflow/js/buildtarget to depend on both sync targetspkg/cli/actions_build_command.go:
buildSetupAction()to NOT copy any files (both JS and shell are now source of truth)ActionsCleanCommand()to NOT remove js/ or sh/ directories from actions/setup.gitattributes:
pkg/workflow/sh/*.sh linguist-generated=trueto mark generated shell filespkg/workflow/js/*.cjs linguist-generated=trueto mark generated JavaScript filesactions/setup/js/*.cjs linguist-generated=true(no longer generated)Documentation:
Sync Patterns
Both file types now follow the SAME pattern:
actions/setup/sh/pkg/workflow/sh/make sync-shell-scripts(runs beforebuild)actions/setup/js/pkg/workflow/js/make sync-js-scripts(runs beforebuild)Key points:
actions/setup/as source of truthpkg/workflow/duringmake build//go:embed*.test.cjs) remain only inpkg/workflow/js/and are not syncedTesting Results
✅ All tests passed:
make sync-shell-scriptscopies 6 shell files correctlymake sync-js-scriptscopies 117 JavaScript files correctlymake buildautomatically runs both syncs and builds successfullymake actions-buildworks correctly, showing files as source of truthOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.