-
-
Notifications
You must be signed in to change notification settings - Fork 557
fix: gracefully fallback to body when body_path cannot be read #671
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
Merged
chenrui333
merged 2 commits into
master
from
copilot/fix-b77e322d-b384-4bfb-8bed-e6a6c53e14ca
Oct 7, 2025
Merged
fix: gracefully fallback to body when body_path cannot be read #671
chenrui333
merged 2 commits into
master
from
copilot/fix-b77e322d-b384-4bfb-8bed-e6a6c53e14ca
Oct 7, 2025
Conversation
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
Co-authored-by: chenrui333 <[email protected]>
Copilot
AI
changed the title
[WIP] Missing body_path file causes abort of action even if fallback body has been set
fix: gracefully fallback to body when body_path cannot be read
Oct 7, 2025
Copilot finished work on behalf of
chenrui333
October 7, 2025 03:17
chenrui333
approved these changes
Oct 7, 2025
mergify bot
added a commit
to robfrank/linklift
that referenced
this pull request
Oct 15, 2025
Bumps the github-actions group with 2 updates: [softprops/action-gh-release](https://github.com/softprops/action-gh-release) and [ruby/setup-ruby](https://github.com/ruby/setup-ruby). Updates `softprops/action-gh-release` from 2.3.4 to 2.4.1 Release notes *Sourced from [softprops/action-gh-release's releases](https://github.com/softprops/action-gh-release/releases).* > v2.4.1 > ------ > > What's Changed > -------------- > > ### Other Changes 🔄 > > * fix(util): support brace expansion globs containing commas in parseInputFiles by [`@Copilot`](https://github.com/Copilot) in [softprops/action-gh-release#672](https://redirect.github.com/softprops/action-gh-release/pull/672) > * fix: gracefully fallback to body when body\_path cannot be read by [`@Copilot`](https://github.com/Copilot) in [softprops/action-gh-release#671](https://redirect.github.com/softprops/action-gh-release/pull/671) > > **Full Changelog**: <softprops/action-gh-release@v2...v2.4.1> > > v2.4.0 > ------ > > What's Changed > -------------- > > ### Exciting New Features 🎉 > > * feat(action): respect working\_directory for files globs by [`@stephenway`](https://github.com/stephenway) in [softprops/action-gh-release#667](https://redirect.github.com/softprops/action-gh-release/pull/667) > > ### Other Changes 🔄 > > * chore(deps): bump the npm group with 2 updates by [`@dependabot`](https://github.com/dependabot)[bot] in [softprops/action-gh-release#668](https://redirect.github.com/softprops/action-gh-release/pull/668) > > **Full Changelog**: <softprops/action-gh-release@v2.3.4...v2.4.0> Changelog *Sourced from [softprops/action-gh-release's changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md).* > 2.4.1 > ----- > > What's Changed > -------------- > > ### Other Changes 🔄 > > * fix(util): support brace expansion globs containing commas in parseInputFiles by [`@Copilot`](https://github.com/Copilot) in [softprops/action-gh-release#672](https://redirect.github.com/softprops/action-gh-release/pull/672) > * fix: gracefully fallback to body when body\_path cannot be read by [`@Copilot`](https://github.com/Copilot) in [softprops/action-gh-release#671](https://redirect.github.com/softprops/action-gh-release/pull/671) > > 2.4.0 > ----- > > What's Changed > -------------- > > ### Exciting New Features 🎉 > > * feat(action): respect working\_directory for files globs by [`@stephenway`](https://github.com/stephenway) in [softprops/action-gh-release#667](https://redirect.github.com/softprops/action-gh-release/pull/667) > > 2.3.4 > ----- > > What's Changed > -------------- > > ### Bug fixes 🐛 > > * fix(action): handle 422 already\_exists race condition by [`@stephenway`](https://github.com/stephenway) in [softprops/action-gh-release#665](https://redirect.github.com/softprops/action-gh-release/pull/665) > > ### Other Changes 🔄 > > * dependency updates > > 2.3.3 > ----- > > What's Changed > -------------- > > ### Exciting New Features 🎉 > > * feat: add input option `overwrite_files` by [`@asfernandes`](https://github.com/asfernandes) in [softprops/action-gh-release#343](https://redirect.github.com/softprops/action-gh-release/pull/343) > > ### Other Changes 🔄 > > * dependency updates > > 2.3.2 > ----- > > * fix: revert fs `readableWebStream` change > > 2.3.1 > ----- > > ### Bug fixes 🐛 > > * fix: fix file closing issue by [`@WailGree`](https://github.com/WailGree) in [softprops/action-gh-release#629](https://redirect.github.com/softprops/action-gh-release/pull/629) ... (truncated) Commits * [`6da8fa9`](softprops/action-gh-release@6da8fa9) release 2.4.1 * [`f38efde`](softprops/action-gh-release@f38efde) fix: gracefully fallback to body when body\_path cannot be read ([#671](https://redirect.github.com/softprops/action-gh-release/issues/671)) * [`cec1a11`](softprops/action-gh-release@cec1a11) fix(util): support brace expansion globs containing commas in parseInputFiles... * [`aec2ec5`](softprops/action-gh-release@aec2ec5) release 2.4.0 * [`4db716b`](softprops/action-gh-release@4db716b) feat: respect working\_directory for files globs; add input and tests ([#667](https://redirect.github.com/softprops/action-gh-release/issues/667)) * [`14820f2`](softprops/action-gh-release@14820f2) chore(deps): bump the npm group with 2 updates ([#668](https://redirect.github.com/softprops/action-gh-release/issues/668)) * See full diff in [compare view](softprops/action-gh-release@62c96d0...6da8fa9) Updates `ruby/setup-ruby` from 1.263.0 to 1.265.0 Release notes *Sourced from [ruby/setup-ruby's releases](https://github.com/ruby/setup-ruby/releases).* > v1.265.0 > -------- > > What's Changed > -------------- > > * Update CRuby releases on Windows by [`@ruby-builder-bot`](https://github.com/ruby-builder-bot) in [ruby/setup-ruby#817](https://redirect.github.com/ruby/setup-ruby/pull/817) > > **Full Changelog**: <ruby/setup-ruby@v1.264.0...v1.265.0> > > v1.264.0 > -------- > > What's Changed > -------------- > > * Add ruby-3.4.7 by [`@ruby-builder-bot`](https://github.com/ruby-builder-bot) in [ruby/setup-ruby#815](https://redirect.github.com/ruby/setup-ruby/pull/815) > > **Full Changelog**: <ruby/setup-ruby@v1.263.0...v1.264.0> Commits * [`ab177d4`](ruby/setup-ruby@ab177d4) Update CRuby releases on Windows * [`6797dcb`](ruby/setup-ruby@6797dcb) Add ruby-3.4.7 * [`a16e0e6`](ruby/setup-ruby@a16e0e6) Test on macos-15-intel too * See full diff in [compare view](ruby/setup-ruby@0481980...ab177d4) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- Dependabot commands and options You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself) - `@dependabot ignore minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself) - `@dependabot ignore ` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself) - `@dependabot unignore ` will remove all of the ignore conditions of the specified dependency - `@dependabot unignore ` will remove the ignore condition of the specified dependency and ignore conditions
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.
Problem
When using both
body_pathandbodyinputs, if the file specified inbody_pathdoesn't exist, the action crashes with anENOENTexception instead of falling back to thebodyinput as documented in the README.The README states:
However, the current implementation uses
readFileSyncwithout error handling, causing the action to abort when the file is missing.Solution
Modified the
releaseBodyfunction insrc/util.tsto safely attempt reading thebody_pathfile with proper error handling:readFileSyncin a try-catch block to handle file read errors (ENOENT, permission errors, etc.)⚠️ Failed to read body_path "<path>" (<error_code>). Falling back to 'body' input.bodyinput as fallback when file read failsundefinedif bothbody_pathfails andbodyis not providedExample Usage
With this fix, if
pipeline-changes.txtdoesn't exist, the action will use'Default release notes'instead of crashing.Testing
Added comprehensive test coverage:
bodywhenbody_pathfile is missingundefinedwhen bothbody_pathfails andbodyis not providedFixes the issue where missing
body_pathfiles cause action failure even when a fallbackbodyis configured.Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.