Skip to content

Commit bfbf9dd

Browse files
authored
ci: use sha pinning to mitigate (#50)
* ci: use sha pinning to mitigate Lower risk about supply chain attack even though matched tag was compromised. Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com> * ci: workaround bundler-cache: true installation failure It will fix: Installing Bundler Ruby 2.3.2 - 2.5 only works with Bundler 2.3 /opt/hostedtoolcache/Ruby/2.5.0/x64/bin/gem install bundler -v ~> 2.3.0 Successfully installed bundler-2.3.27 1 gem installed Took 14.36 seconds > bundle install Setting BUNDLER_VERSION=2.3 for "bundle config|lock" commands below to ensure Bundler 2.3 is used /opt/hostedtoolcache/Ruby/2.5.0/x64/bin/bundle config set --local path /home/runner/work/fluent-plugin-formatter-protobuf/fluent-plugin-formatter-protobuf/vendor/bundle /opt/hostedtoolcache/Ruby/2.5.0/x64/lib/ruby/2.5.0/rubygems.rb:289:in `find_spec_for_exe': can't find gem bundler (>= 0.a) with executable bundle (Gem::GemNotFoundException) from /opt/hostedtoolcache/Ruby/2.5.0/x64/lib/ruby/2.5.0/rubygems.rb:308:in `activate_bin_path' from /opt/hostedtoolcache/Ruby/2.5.0/x64/bin/bundle:23:in `<main>' Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com> --------- Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
1 parent 1c6744d commit bfbf9dd

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

.github/workflows/build-and-test.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ jobs:
1313
contents: read
1414

1515
steps:
16-
- uses: actions/checkout@v2
16+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1717
- name: Set up Ruby 2.5
18-
uses: ruby/setup-ruby@v1
19-
with:
20-
bundler-cache: true
18+
uses: ruby/setup-ruby@09a7688d3b55cf0e976497ff046b70949eeaccfd # v1.288.0
19+
- name: Install bundler explicitly for Ruby 2.5
20+
run: |
21+
gem install bundler -v 2.3.27
22+
bundle _2.3.27_ install
2123
- name: "Linting"
2224
run: "bundle exec rake lint:check"
2325

@@ -36,9 +38,9 @@ jobs:
3638
- '2.6'
3739
- '2.5'
3840
steps:
39-
- uses: actions/checkout@v2
41+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4042
- name: Set up Ruby
41-
uses: ruby/setup-ruby@v1
43+
uses: ruby/setup-ruby@09a7688d3b55cf0e976497ff046b70949eeaccfd # v1.288.0
4244
with:
4345
bundler-cache: true
4446
ruby-version: ${{ matrix.ruby-version }}
@@ -61,9 +63,9 @@ jobs:
6163
- '2.5'
6264

6365
steps:
64-
- uses: actions/checkout@v2
66+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
6567
- name: Set up Ruby
66-
uses: ruby/setup-ruby@v1
68+
uses: ruby/setup-ruby@09a7688d3b55cf0e976497ff046b70949eeaccfd # v1.288.0
6769
with:
6870
bundler-cache: true
6971
ruby-version: ${{ matrix.ruby-version }}

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424

2525
steps:
2626
- name: Checkout repository
27-
uses: actions/checkout@v2
27+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2828

2929
- name: Initialize CodeQL
3030
uses: github/codeql-action/init@v1

.github/workflows/release-please.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515
release-type: ruby
1616
version-file: "lib/fluent/plugin/version.rb"
1717

18-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1919

2020
- name: Set up Ruby
21-
uses: ruby/setup-ruby@v1
21+
uses: ruby/setup-ruby@09a7688d3b55cf0e976497ff046b70949eeaccfd # v1.288.0
2222
with:
2323
bundler-cache: true
2424
ruby-version: '2.5'

0 commit comments

Comments
 (0)