-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Fix YAML syntax error in workflow file #11275
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 | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -49,7 +49,7 @@ jobs: | |||||||||||||
| with: | ||||||||||||||
| script: | | ||||||||||||||
| // Use the captured output from the previous step | ||||||||||||||
| const output = `${{ steps.pg_check.outputs.output }}`; | ||||||||||||||
| const output = '${{ steps.pg_check.outputs.output }}'; | ||||||||||||||
| let issuesContent = ''; | ||||||||||||||
|
Comment on lines
+52
to
53
Contributor
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. Suggestion: Add a size/emptiness guard for
Suggested change
|
||||||||||||||
|
|
||||||||||||||
| try { | ||||||||||||||
|
|
@@ -73,29 +73,23 @@ jobs: | |||||||||||||
| issuesContent = '*Unable to extract detailed issues*'; | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| const commentBody = `## ⚠️ Parameter Group Version Check | ||||||||||||||
|
|
||||||||||||||
| The following parameter groups may need version increments: | ||||||||||||||
|
|
||||||||||||||
| ${issuesContent} | ||||||||||||||
|
|
||||||||||||||
| **Why this matters:** | ||||||||||||||
| Modifying PG struct fields without incrementing the version can cause settings corruption when users flash new firmware. The \`pgLoad()\` function validates versions and will use defaults if there's a mismatch, preventing corruption. | ||||||||||||||
|
|
||||||||||||||
| **When to increment the version:** | ||||||||||||||
| - ✅ Adding/removing fields | ||||||||||||||
| - ✅ Changing field types or sizes | ||||||||||||||
| - ✅ Reordering fields | ||||||||||||||
| - ✅ Adding/removing packing attributes | ||||||||||||||
| - ❌ Only changing default values in \`PG_RESET_TEMPLATE\` | ||||||||||||||
| - ❌ Only changing comments | ||||||||||||||
|
|
||||||||||||||
| **Reference:** | ||||||||||||||
| - [Parameter Group Documentation](../docs/development/parameter_groups/) | ||||||||||||||
| - Example: [PR #11236](https://github.com/iNavFlight/inav/pull/11236) (field removal requiring version increment) | ||||||||||||||
|
|
||||||||||||||
| --- | ||||||||||||||
| *This is an automated check. False positives are possible. If you believe the version increment is not needed, please explain in a comment.*`; | ||||||||||||||
| const commentBody = '## ⚠️ Parameter Group Version Check\n\n' + | ||||||||||||||
| 'The following parameter groups may need version increments:\n\n' + | ||||||||||||||
| issuesContent + '\n\n' + | ||||||||||||||
|
Contributor
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. Suggestion: Wrap the
Suggested change
|
||||||||||||||
| '**Why this matters:**\n' + | ||||||||||||||
| 'Modifying PG struct fields without incrementing the version can cause settings corruption when users flash new firmware. The `pgLoad()` function validates versions and will use defaults if there\'s a mismatch, preventing corruption.\n\n' + | ||||||||||||||
| '**When to increment the version:**\n' + | ||||||||||||||
| '- ✅ Adding/removing fields\n' + | ||||||||||||||
| '- ✅ Changing field types or sizes\n' + | ||||||||||||||
| '- ✅ Reordering fields\n' + | ||||||||||||||
| '- ✅ Adding/removing packing attributes\n' + | ||||||||||||||
| '- ❌ Only changing default values in `PG_RESET_TEMPLATE`\n' + | ||||||||||||||
| '- ❌ Only changing comments\n\n' + | ||||||||||||||
| '**Reference:**\n' + | ||||||||||||||
| '- [Parameter Group Documentation](../docs/development/parameter_groups/)\n' + | ||||||||||||||
| '- Example: [PR #11236](https://github.com/iNavFlight/inav/pull/11236) (field removal requiring version increment)\n\n' + | ||||||||||||||
| '---\n' + | ||||||||||||||
| '*This is an automated check. False positives are possible. If you believe the version increment is not needed, please explain in a comment.*'; | ||||||||||||||
|
|
||||||||||||||
| try { | ||||||||||||||
| // Check if we already commented | ||||||||||||||
|
|
||||||||||||||
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.
High-level Suggestion
To improve readability and maintainability, extract the inline JavaScript from the YAML workflow into a separate
.jsfile. This avoids syntax conflicts and makes the script easier to manage. [High-level, importance: 8]Solution Walkthrough:
Before:
After: