Skip to content

Conversation

Copy link

Copilot AI commented Dec 3, 2025

What does it do?

Addresses https://github.com/wordpress-mobile/release-toolkit/pull/677/files#r2583457311

The .buildkite/shared-pipeline-vars script hardcoded the Ruby version instead of reading from .ruby-version. This change uses ${BASH_SOURCE[0]} to construct a location-independent path to .ruby-version, ensuring the script works regardless of the sourcing directory.

Before:

export RUBY_VERSION="3.2.2"

After:

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
export RUBY_VERSION="$(cat "$SCRIPT_DIR/../.ruby-version")"

Checklist before requesting a review

  • Run bundle exec rubocop to test for code style violations and recommendations. (Shell script change only)
  • Add Unit Tests (aka specs/*_spec.rb) if applicable. (No test infrastructure for shell scripts)
  • Run bundle exec rspec to run the whole test suite and ensure all your tests pass. (Shell script change only)
  • Make sure you added an entry in the CHANGELOG.md file to describe your changes under the appropriate existing ### subsection of the existing ## Trunk section. (Internal tooling change)
  • If applicable, add an entry in the MIGRATION.md file to describe how the changes will affect the migration from the previous major version and what the clients will need to change and consider. (Not applicable)
Original prompt

This section details on the original issue you should resolve

<issue_title>Use robust path when reading .ruby-version</issue_title>
<issue_description>See https://github.com/wordpress-mobile/release-toolkit/pull/677/files#r2583457311

</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@dangermattic
Copy link
Collaborator

1 Warning
⚠️ Please add an entry in the CHANGELOG.md file to describe the changes made by this PR
1 Message
📖 This PR is still a Draft: some checks will be skipped.

Generated by 🚫 Danger

Instead of hardcoding the Ruby version, read it from .ruby-version
file using a path relative to the script location. This makes the
script work correctly regardless of where it's sourced from.

Co-authored-by: mokagio <[email protected]>
Copilot AI changed the title [WIP] Use robust path when reading .ruby-version Use robust path when reading .ruby-version Dec 3, 2025
Copilot AI requested a review from mokagio December 3, 2025 03:27
Copilot finished work on behalf of mokagio December 3, 2025 03:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use robust path when reading .ruby-version

3 participants