Conversation
There was a problem hiding this comment.
Pull request overview
Updates the GitHub Actions CI workflow assertion to match the current error message returned by RubyGems when attempting to publish an invalid gem, keeping the “trusted publisher” token test job passing.
Changes:
- Update the expected RubyGems error text in the workflow’s “Test token” step.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| output="$(curl -s -w "\n\n%{http_code}" -v -X POST 'https://${{ matrix.gem-server }}/api/v1/gems' -H "Authorization: $RUBYGEMS_API_KEY" -H 'Accept: application/json')" | ||
| expected="$(printf "RubyGems.org cannot process this gem.\nPlease try rebuilding it and installing it locally to make sure it's valid.\nError:\npackage metadata is missing\n\n\n422")" | ||
| expected="$(printf "RubyGems.org cannot process this gem.\nPlease try rebuilding it and installing it locally to make sure it's valid.\nError:\ngem package contains no entries\n\n\n422")" | ||
| test "$output" = "$expected" || (echo "$output" && exit 1) |
There was a problem hiding this comment.
The workflow asserts exact equality of the full error body from a third-party service (RubyGems). This is brittle and will keep breaking whenever RubyGems changes wording/formatting (as evidenced by this update). Consider asserting on the HTTP status code (422) separately and matching only a stable substring (or JSON field, if available) rather than the entire response text.
No description provided.