Commit 0481980
Print lockfile contents earlier
Currently, the lockfile gets printed after `bundle install` finished. This could be too late when `bundle install` fails for whatever reason.
I have a workflow that failed like this:
<details><summary>Logs</summary>
<p>
```
55s
Run ruby/setup-ruby@v1
Modifying PATH
Downloading Ruby
Extracting Ruby
Print Ruby version
Installing Bundler
> bundle install
/opt/hostedtoolcache/Ruby/2.7.8/x64/bin/bundle config --local path /home/runner/work/rubocop/rubocop/vendor/bundle
/opt/hostedtoolcache/Ruby/2.7.8/x64/bin/bundle lock
Fetching source index from https://rubygems.org/
Network error while fetching
https://rubygems.org/quick/Marshal.4.8/asciidoctor-0.0.1.gemspec.rz (Connection
reset by peer - SSL_connect)
Error: The process '/opt/hostedtoolcache/Ruby/2.7.8/x64/bin/bundle' failed with exit code 17
Run ruby/setup-ruby@v1
Modifying PATH
Downloading Ruby
Extracting Ruby
Print Ruby version
Installing Bundler
> bundle install
/opt/hostedtoolcache/Ruby/2.7.8/x64/bin/bundle config --local path /home/runner/work/rubocop/rubocop/vendor/bundle
/opt/hostedtoolcache/Ruby/2.7.8/x64/bin/bundle lock
Fetching source index from https://rubygems.org/
Network error while fetching
https://rubygems.org/quick/Marshal.4.8/asciidoctor-0.0.1.gemspec.rz (Connection
reset by peer - SSL_connect)
Error: The process '/opt/hostedtoolcache/Ruby/2.7.8/x64/bin/bundle' failed with exit code 17
```
</p>
</details>
It would help to print the lockfile for this I think. It fetching version 0.0.1 confused me but probably the lockfile looks ok. New output:
```
Run ./
Modifying PATH
Print Ruby version
Installing Bundler
> bundle install
/opt/hostedtoolcache/Ruby/3.2.9/x64/bin/bundle config --local path /home/runner/work/setup-ruby/setup-ruby/vendor/bundle
/opt/hostedtoolcache/Ruby/3.2.9/x64/bin/bundle lock
Fetching gem metadata from https://rubygems.org/...........
Resolving dependencies...
Writing lockfile to /home/runner/work/setup-ruby/setup-ruby/gemfiles/rails8.gemfile.lock
Print lockfile
Cache key: setup-ruby-bundler-cache-v6-ubuntu-24.04-x64-ruby-3.2.9-wd-/home/runner/work/setup-ruby/setup-ruby-with--without--only--/home/runner/work/setup-ruby/setup-ruby/gemfiles/rails8.gemfile.lock-cb69172094f71f01e5207070d9af8d465d9aa9c386ecbad22b1b6e8e43523fd2
/opt/hostedtoolcache/Ruby/3.2.9/x64/bin/bundle install --jobs 4
...
```
So it's relatively at the top and not hidden somewhere. Also removes the need to check for the lockfile again.1 parent cf7216d commit 0481980
3 files changed
+6
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
168 | 171 | | |
169 | 172 | | |
170 | 173 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | 102 | | |
108 | 103 | | |
109 | 104 | | |
| |||
0 commit comments