feat(ci): use generated title for regen PR#28
Conversation
| title: "${{ inputs.title || 'chore: regenerate client from updated OpenAPI spec' }}" | ||
| branch: openapi-update-${{ github.run_id }} | ||
| commit-message: "chore: regenerate client from OpenAPI spec" | ||
| body: "Auto-generated from updated HotData OpenAPI spec." | ||
| commit-message: "${{ inputs.title || 'chore: regenerate client from OpenAPI spec' }}" | ||
| body: "${{ inputs.summary || 'Auto-generated from updated HotData OpenAPI spec.' }}" |
There was a problem hiding this comment.
nit: wrapping ${{ ... }} in "..." does textual substitution into a YAML double-quoted scalar, so any " or \ in inputs.title/inputs.summary will produce invalid YAML and fail the step before the action ever runs. Since summary is intended to hold a PR body (likely multi-line markdown with backticks/quotes generated upstream), this is fragile in practice.
Dropping the outer quotes makes the expression result the entire YAML value directly, which avoids re-parsing the substituted text:
| title: "${{ inputs.title || 'chore: regenerate client from updated OpenAPI spec' }}" | |
| branch: openapi-update-${{ github.run_id }} | |
| commit-message: "chore: regenerate client from OpenAPI spec" | |
| body: "Auto-generated from updated HotData OpenAPI spec." | |
| commit-message: "${{ inputs.title || 'chore: regenerate client from OpenAPI spec' }}" | |
| body: "${{ inputs.summary || 'Auto-generated from updated HotData OpenAPI spec.' }}" | |
| title: ${{ inputs.title || 'chore: regenerate client from updated OpenAPI spec' }} | |
| branch: openapi-update-${{ github.run_id }} | |
| commit-message: ${{ inputs.title || 'chore: regenerate client from OpenAPI spec' }} | |
| body: ${{ inputs.summary || 'Auto-generated from updated HotData OpenAPI spec.' }} |
(not blocking)
There was a problem hiding this comment.
Good catch on the fragility, but dropping the outer quotes breaks raw-YAML parsing here: the fallback string 'chore: regenerate client from updated OpenAPI spec' contains a literal : , so unquoted the value parses as a nested mapping (mapping values are not allowed here). So the quotes need to stay.
Handling the real risk upstream instead: the title is now sanitized at the source in www (notify-sdks.yml / api-docs.yml) with tr -d '\r"\\' | cut -c1-100, stripping quotes/backslashes/newlines and enforcing the length cap before it is ever dispatched here. With the value guaranteed clean, the quoted interpolation is safe. Keeping as-is.
Accepts
title/summaryworkflow_dispatch inputs from www's notify-sdks so regeneration PRs reflect the actual API changes, falling back to the static title for manual runs.