Skip to content

Commit 312f3d0

Browse files
committed
Improve the README, move the working directory section, mention $BUNDLE_GEMFILE
1 parent 273e744 commit 312f3d0

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

README.md

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,16 @@ and the [condition and expression syntax](https://help.github.com/en/actions/ref
108108
* `.tool-versions` reads from the project's `.tool-versions` file
109109
* If the `ruby-version` input is not specified, `.ruby-version` is tried first, followed by `.tool-versions`
110110

111+
### Working Directory
112+
113+
The `working-directory` input can be set to resolve `.ruby-version`, `.tool-versions` and `Gemfile.lock`
114+
if they are not at the root of the repository, see [action.yml](action.yml) for details.
115+
111116
### Bundler
112117

113-
By default, if there is a `Gemfile.lock` file with a `BUNDLED WITH` section,
118+
By default, if there is a `Gemfile.lock` file (or `$BUNDLE_GEMFILE.lock` if `$BUNDLE_GEMFILE` is set) with a `BUNDLED WITH` section,
114119
the latest version of Bundler with the same major version will be installed.
115-
Otherwise, the latest Bundler version is installed (except for Ruby 2.2 and 2.3 where only Bundler 1 is supported).
116-
117-
If your gemfile is not named "Gemfile" or if your project includes multiple gemfiles, you can set the path to a gemfile with the `BUNDLE_GEMFILE` environment variable. The ".lock" suffix will be added to the path before evaluating the file.
120+
Otherwise, the latest compatible Bundler version is installed (Bundler 2 on Ruby >= 2.4, Bundler 1 on Ruby < 2.4).
118121

119122
This behavior can be customized, see [action.yml](action.yml) for details about the `bundler` input.
120123

@@ -128,7 +131,7 @@ This action provides a way to automatically run `bundle install` and cache the r
128131
```
129132

130133
This caching speeds up installing gems significantly and avoids too many requests to RubyGems.org.
131-
It needs a `Gemfile` under the [`working-directory`](#working-directory).
134+
It needs a `Gemfile` (or `$BUNDLE_GEMFILE`) under the [`working-directory`](#working-directory).
132135
The caching works whether there is a `Gemfile.lock` or not.
133136
If there is a `Gemfile.lock`, `bundle config --local deployment true` is used.
134137

@@ -164,11 +167,6 @@ This uses the [cache action](https://github.com/actions/cache).
164167
The code above is a more complete version of the [Ruby - Bundler example](https://github.com/actions/cache/blob/master/examples.md#ruby---bundler).
165168
Make sure to include `use-ruby` in the `key` to avoid conflicting with previous caches.
166169

167-
### Working Directory
168-
169-
The `working-directory` input can be set to resolve `.ruby-version`, `.tool-versions` and `Gemfile.lock`
170-
if they are not at the root of the repository, see [action.yml](action.yml) for details.
171-
172170
## Windows
173171

174172
Note that running CI on Windows can be quite challenging if you are not very familiar with Windows.
@@ -193,9 +191,7 @@ Make sure to always use the latest release before reporting an issue on GitHub.
193191
This action follows semantic versioning with a moving `v1` branch.
194192
This follows the [recommendations](https://github.com/actions/toolkit/blob/master/docs/action-versioning.md) of GitHub Actions.
195193

196-
## Limitations
197-
198-
### Using self-hosted runners
194+
## Using self-hosted runners
199195
You must meet the following parameters to use this action with self-hosted runners:
200196

201197
* Make sure that the operating system has `libyaml-0` installed

action.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ inputs:
1010
required: false
1111
default: 'default'
1212
bundler:
13-
description: 'The version of Bundler to install. Either none, 1, 2, latest or Gemfile.lock. For Gemfile.lock, the version is determined based on the BUNDLED WITH section from the file ($BUNDLE_GEMFILE || Gemfile).lock. Defaults to Gemfile.lock if it exists and latest otherwise.'
13+
description: |
14+
The version of Bundler to install. Either 'none', 1, 2, 'latest' or 'Gemfile.lock'.
15+
For 'Gemfile.lock', the version is determined based on the BUNDLED WITH section from the file ($BUNDLE_GEMFILE || Gemfile).lock.
16+
Defaults to 'Gemfile.lock' if it exists and 'latest' otherwise.
1417
required: false
1518
default: 'default'
1619
bundler-cache:

0 commit comments

Comments
 (0)