From 373a772b09c2c9d081044e804c7afe0b29ffe1ce Mon Sep 17 00:00:00 2001 From: Jeff Widman Date: Thu, 4 Aug 2022 11:00:04 -0600 Subject: [PATCH] Add a `.ruby-version` file We're starting to pin the desired ruby version in multiple places: * Rubocop * the new `ruby/setup-ruby` action that we're adding in https://github.com/dependabot/dependabot-core/pull/5433 We used to not ship the `.ruby-version` file, with the thought that this is a library... but this file isn't included in the gemfile spec, so we're not tying the hands of our users. This merely sets the default version of Ruby that we're using for development. We will keep this in sync with the version of Ruby installed in the Dockerfile, so it'll target the version of Ruby we use in production at GitHub. But since not included in the gem, others are free to use a different Ruby version. Copy the `.ruby-version` file into the CI container. --- .gitignore | 1 - .rubocop.yml | 1 - .ruby-version | 1 + Dockerfile.ci | 1 + 4 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 .ruby-version diff --git a/.gitignore b/.gitignore index 1313743c09..1192254f7f 100644 --- a/.gitignore +++ b/.gitignore @@ -26,5 +26,4 @@ vendor /.core-bash_history coverage/ .ruby-gemset -.ruby-version .tool-versions diff --git a/.rubocop.yml b/.rubocop.yml index 6da21a454a..c8479fc29a 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -6,7 +6,6 @@ AllCops: - "*/bin/**/*" - "**/tmp/**/*" - "*/spec/fixtures/**/*" - TargetRubyVersion: 2.7 SuggestExtensions: false Gemspec/DeprecatedAttributeAssignment: Enabled: true diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000000..49cdd668e1 --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +2.7.6 diff --git a/Dockerfile.ci b/Dockerfile.ci index c094ee0e7d..3eb3157734 100644 --- a/Dockerfile.ci +++ b/Dockerfile.ci @@ -6,6 +6,7 @@ RUN git config --global user.name dependabot-ci \ ARG CODE_DIR=/home/dependabot/dependabot-core WORKDIR ${CODE_DIR} +COPY --chown=dependabot:dependabot .ruby-version ${CODE_DIR}/.ruby-version COPY --chown=dependabot:dependabot .rubocop.yml ${CODE_DIR}/.rubocop.yml COPY --chown=dependabot:dependabot omnibus ${CODE_DIR}/omnibus COPY --chown=dependabot:dependabot git_submodules ${CODE_DIR}/git_submodules