Skip to content

Commit ecb2c5d

Browse files
authored
Added support to install gems from private repositories. (#20)
* setting git config to install private gems Signed-off-by: nikhil2611 <ngupta@progress.com> * updated with github config in sbom.yml also Signed-off-by: nikhil2611 <ngupta@progress.com> * updated the var name Signed-off-by: nikhil2611 <ngupta@progress.com> * Security: Replace git config with bundler config for gem credentials Signed-off-by: nikhil2611 <ngupta@progress.com> * testing with feature branch Signed-off-by: nikhil2611 <ngupta@progress.com> * reverted back to main Signed-off-by: nikhil2611 <ngupta@progress.com> * added the condition for PRIVATE_ACCESS_KITCHEN_CHEF_ENTERPRISE Signed-off-by: nikhil2611 <ngupta@progress.com> * making logs better Signed-off-by: nikhil2611 <ngupta@progress.com> * updating to feature branch to test the changes Signed-off-by: nikhil2611 <ngupta@progress.com> * revert back to main Signed-off-by: nikhil2611 <ngupta@progress.com> --------- Signed-off-by: nikhil2611 <ngupta@progress.com>
1 parent 9f6c473 commit ecb2c5d

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

.github/workflows/ci-main-pull-request.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -983,6 +983,17 @@ jobs:
983983
uses: ruby/setup-ruby@v1
984984
with:
985985
ruby-version: '3.4'
986+
bundler-cache: false
987+
988+
- name: Configure Bundler for private Ruby gems
989+
if: ${{ inputs.language == 'ruby' && inputs.build-profile == 'cli' }}
990+
run: |
991+
if [ -z "${{ secrets.PRIVATE_ACCESS_KITCHEN_CHEF_ENTERPRISE }}" ]; then
992+
echo "Skipping: PRIVATE_ACCESS_KITCHEN_CHEF_ENTERPRISE secret not configured or not in scope"
993+
exit 0
994+
fi
995+
bundle config set --local github.com "x-access-token:${{ secrets.PRIVATE_ACCESS_KITCHEN_CHEF_ENTERPRISE }}"
996+
986997
- name: 'Ruby build'
987998
if: ${{ inputs.language == 'ruby' && inputs.build-profile == 'cli' }}
988999
continue-on-error: true

.github/workflows/sbom.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,15 @@ jobs:
241241
bundler-cache: false
242242
working-directory: ${{ inputs.ruby-app-directory != '' && inputs.ruby-app-directory || '.' }}
243243

244+
- name: Configure Bundler for private Ruby gems
245+
if: ${{ inputs.run-bundle-install == true && inputs.language == 'ruby' }}
246+
run: |
247+
if [ -z "${{ secrets.PRIVATE_ACCESS_KITCHEN_CHEF_ENTERPRISE }}" ]; then
248+
echo "Skipping: PRIVATE_ACCESS_KITCHEN_CHEF_ENTERPRISE secret not configured or not in scope"
249+
exit 0
250+
fi
251+
bundle config set --local github.com "x-access-token:${{ secrets.PRIVATE_ACCESS_KITCHEN_CHEF_ENTERPRISE }}"
252+
244253
- name: Set up Erlang/OTP and rebar3
245254
if: inputs.language == 'erlang'
246255
uses: erlef/setup-beam@v1

0 commit comments

Comments
 (0)