Skip to content

Commit df39fd3

Browse files
committed
Ruby workflow enhancements
- checkout@v3 uses a deprecated Node.js v16 runtime and should be updated to v4 - Ruby 3.3 (not 3.2) is the latest stable Ruby, so update setup-ruby to use v3.3 - We have multiple public Ruby repos that have `Gemfile.lock` intentionally ignored by Git, but FOSSA wants that file so autogenerate it running `bundle lock` where appropriate - Do not run `bundle lock` if a lock file already exists - Handle multiple `Gemfile` locations (the NR Ruby agent has 2) - Ignore the `test/` and `spec/` directories
1 parent 294983c commit df39fd3

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

.github/workflows/fossa-ruby-bundler.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,22 @@ jobs:
2222
FOSSA_ANALYZE_RESULT: ""
2323

2424
steps:
25-
- uses: actions/checkout@v3
25+
- uses: actions/checkout@v4
2626
- uses: ruby/setup-ruby@v1
2727
with:
28-
ruby-version: '3.2'
28+
ruby-version: '3.3'
29+
- name: Ensure that a Gemfile.lock file exists for each Gemfile file
30+
run: |
31+
echo "Ensuring that Gemfile.lock files exist..."
32+
for gemfile in $(find . -name Gemfile -not -path './test/**' -not -path './spec/**'); do
33+
dir=${gemfile%/*}
34+
echo "Found Gemfile at $dir"
35+
if [[ -e "$dir/Gemfile.lock" ]]; then
36+
echo "Found Gemfile.lock at $dir"
37+
else
38+
echo "No Gemfile.lock found at $dir - generating one..."
39+
bundle lock --gemfile "$dir/Gemfile"
40+
fi
41+
done
2942
- id: fossa-cli
3043
uses: newrelic/.github/.github/composite/fossa-composite@main

0 commit comments

Comments
 (0)