From ba9e71c195cadabb5051b7f88255085a846ee77e Mon Sep 17 00:00:00 2001 From: Jason Frey Date: Thu, 24 Jul 2025 16:32:05 -0400 Subject: [PATCH 1/2] Add printing of the lockfile after installation Closes #783 --- .github/workflows/test.yml | 12 ++++++++++++ dist/index.js | 5 +++++ index.js | 5 +++++ 3 files changed, 22 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b07c79402..d9371a319 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -240,6 +240,18 @@ jobs: ruby-version: '2.6' - run: ruby -v + testNoGemfileWithBundlerCache: + name: "Test with no Gemfile but with bundler-cache" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: rm Gemfile + - uses: ./ + with: + ruby-version: '2.6' + bundler-cache: true + - run: ruby -v + testLatestRubygemsVersion: name: "Test rubygems: latest on ${{ matrix.ruby }}" runs-on: ubuntu-latest diff --git a/dist/index.js b/dist/index.js index d82a17d0d..3c983d4ae 100644 --- a/dist/index.js +++ b/dist/index.js @@ -85350,6 +85350,11 @@ async function setupRuby(options = {}) { if (inputs['bundler-cache'] === 'true') { await common.time('bundle install', async () => bundler.bundleInstall(gemfile, lockFile, platform, engine, version, bundlerVersion, inputs['cache-version'])) + + if (fs.existsSync(lockFile)) { + await core.group(`Print lockfile`, async () => + await exec.exec('cat', [lockFile])) + } } core.setOutput('ruby-prefix', rubyPrefix) diff --git a/index.js b/index.js index 62e46feb9..d783d68fd 100644 --- a/index.js +++ b/index.js @@ -99,6 +99,11 @@ export async function setupRuby(options = {}) { if (inputs['bundler-cache'] === 'true') { await common.time('bundle install', async () => bundler.bundleInstall(gemfile, lockFile, platform, engine, version, bundlerVersion, inputs['cache-version'])) + + if (fs.existsSync(lockFile)) { + await core.group(`Print lockfile`, async () => + await exec.exec('cat', [lockFile])) + } } core.setOutput('ruby-prefix', rubyPrefix) From bb6434c747fa7022e12fa1cae2a0951fcffcff26 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Sat, 26 Jul 2025 10:51:20 +0200 Subject: [PATCH 2/2] Add non-null check --- dist/index.js | 2 +- index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index 3c983d4ae..4df23eced 100644 --- a/dist/index.js +++ b/dist/index.js @@ -85351,7 +85351,7 @@ async function setupRuby(options = {}) { await common.time('bundle install', async () => bundler.bundleInstall(gemfile, lockFile, platform, engine, version, bundlerVersion, inputs['cache-version'])) - if (fs.existsSync(lockFile)) { + if (lockFile !== null && fs.existsSync(lockFile)) { await core.group(`Print lockfile`, async () => await exec.exec('cat', [lockFile])) } diff --git a/index.js b/index.js index d783d68fd..2d29628d7 100644 --- a/index.js +++ b/index.js @@ -100,7 +100,7 @@ export async function setupRuby(options = {}) { await common.time('bundle install', async () => bundler.bundleInstall(gemfile, lockFile, platform, engine, version, bundlerVersion, inputs['cache-version'])) - if (fs.existsSync(lockFile)) { + if (lockFile !== null && fs.existsSync(lockFile)) { await core.group(`Print lockfile`, async () => await exec.exec('cat', [lockFile])) }