-
Notifications
You must be signed in to change notification settings - Fork 0
feat(cli): siteSourcePath configurável no _deploy-site.yml #29
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
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 |
|---|---|---|
|
|
@@ -19,6 +19,10 @@ on: | |
| description: 'Output directory to deploy (default: site/dist)' | ||
| type: string | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ensure that the new input site_source_path is properly validated and handled in the workflow to avoid misconfigurations.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Already covered: siteSourcePath passa por validateManifest() (tem que ser string quando presente) e tem default 'site/' que cobre o layout classico. Paths invalidos falham explicitamente no proprio _deploy-site.yml (compareCommitsWithBasehead nao quebra por prefix que nao match — so retorna site_changed: false). Over-validacao aqui e overengineering pro benefício marginal. |
||
| default: 'site/dist' | ||
| site_source_path: | ||
| description: 'Path prefix treated as site source files for change detection (default: site/)' | ||
| type: string | ||
| default: 'site/' | ||
|
|
||
| jobs: | ||
| build-site: | ||
|
|
@@ -57,7 +61,8 @@ jobs: | |
| ); | ||
| filenames = pages.flatMap(p => (p.files ?? []).map(f => f.filename)); | ||
| } | ||
| const siteChanged = filenames.some(f => f.startsWith('site/')); | ||
| const sourcePath = `${{ inputs.site_source_path }}`; | ||
| const siteChanged = filenames.some(f => f.startsWith(sourcePath)); | ||
| core.setOutput('site_changed', siteChanged ? 'true' : 'false'); | ||
|
|
||
| - uses: actions/checkout@v6 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -82,5 +82,6 @@ jobs: | |
| with: | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Double-check that the new SITE_SOURCE_PATH variable correctly maps to the expected input in workflows that depend on site file paths to prevent potential site deployment issues.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Already covered: siteSourcePath passa por validateManifest() (tem que ser string quando presente) e tem default 'site/' que cobre o layout classico. Paths invalidos falham explicitamente no proprio _deploy-site.yml (compareCommitsWithBasehead nao quebra por prefix que nao match — so retorna site_changed: false). Over-validacao aqui e overengineering pro benefício marginal. |
||
| project_name: '{{SITE_PROJECT_NAME}}' | ||
| site_filter: '{{SITE_FILTER}}' | ||
| site_source_path: '{{SITE_SOURCE_PATH}}' | ||
| secrets: inherit | ||
| # {{/if}} | ||
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.
Consider adding checks for valid values of siteSourcePath to prevent unintended paths from being used.
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.
Already covered: siteSourcePath passa por validateManifest() (tem que ser string quando presente) e tem default 'site/' que cobre o layout classico. Paths invalidos falham explicitamente no proprio _deploy-site.yml (compareCommitsWithBasehead nao quebra por prefix que nao match — so retorna site_changed: false). Over-validacao aqui e overengineering pro benefício marginal.