Skip to content

Commit a27e77a

Browse files
committed
NH-103804: reverselab scan gem
1 parent 92486dd commit a27e77a

File tree

2 files changed

+97
-1
lines changed

2 files changed

+97
-1
lines changed

.github/workflows/build_and_release_gem.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,12 @@ jobs:
8282
draft: true
8383
})
8484
85+
- name: Upload to artifact
86+
uses: actions/upload-artifact@v4
87+
with:
88+
name: solarwinds_apm-${{ steps.build.outputs.gem_version }}.gem
89+
path: solarwinds_apm-${{ steps.build.outputs.gem_version }}.gem
90+
8591
# may need a bit of time for the gem to become available (-> sleep 1)
8692
- name: Download new Rubygem from rubygems.org and test
8793
working-directory: .github/workflows/
@@ -92,3 +98,45 @@ jobs:
9298
sudo apt-get update && sudo apt-get install -y ruby-dev g++ make
9399
gem install solarwinds_apm --version ${{ steps.build.outputs.gem_version }}
94100
ruby ./scripts/test_install.rb
101+
102+
# extract the built layer from artifacts, then scan it with reverselab
103+
reverselab_scan_gem:
104+
needs:
105+
- publish_to_ruby_gem
106+
runs-on: ubuntu-latest
107+
strategy:
108+
fail-fast: false
109+
110+
steps:
111+
- uses: actions/checkout@v4
112+
113+
- name: extract current solarwinds_apm version
114+
id: extract
115+
run: |
116+
APM_VERSION=$(ruby -e 'require "./lib/solarwinds_apm/version"; puts SolarWindsAPM::Version::STRING')
117+
echo "SOLARWINDS_APM_VERSION=$APM_VERSION" >> $GITHUB_ENV
118+
119+
- name: extract layer zip from artifacts
120+
uses: actions/download-artifact@v4
121+
with:
122+
name: solarwinds_apm-${{ env.SOLARWINDS_APM_VERSION }}.gem
123+
path: ./
124+
125+
- name: Scan build artifact on the Portal
126+
id: rl-scan
127+
env:
128+
RLPORTAL_ACCESS_TOKEN: ${{ secrets.REVERSE_LAB_TOKEN }}
129+
uses: reversinglabs/gh-action-rl-scanner-cloud-only@v1
130+
with:
131+
artifact-to-scan: ./solarwinds_apm-${{ steps.SOLARWINDS_APM_VERSION }}.gem
132+
rl-verbose: true
133+
rl-portal-server: solarwinds
134+
rl-portal-org: SolarWinds
135+
rl-portal-group: SaaS-Agents-SWO
136+
rl-package-url: solarwinds-apm-ruby/apm-ruby-prod@${{ env.SOLARWINDS_APM_VERSION }}
137+
138+
- name: report the scan status
139+
if: success() || failure()
140+
run: |
141+
echo "The status is: '${{ steps.rl-scan.outputs.status }}'"
142+
echo "The description is: '${{ steps.rl-scan.outputs.description }}'"

.github/workflows/build_for_github_package.yml

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
workflow_dispatch:
88

99
jobs:
10-
build:
10+
publish_to_github_package:
1111
name: Build + Publish to Github Package
1212
runs-on: ubuntu-latest
1313

@@ -47,3 +47,51 @@ jobs:
4747
bundle exec rake push_gem_to_github_package[${{ steps.version.outputs.gem_version }}]
4848
env:
4949
GITHUB_SECRET_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
51+
- name: Upload to artifact
52+
uses: actions/upload-artifact@v4
53+
with:
54+
name: solarwinds_apm-${{ steps.version.outputs.gem_version }}.gem
55+
path: builds/solarwinds_apm-${{ steps.version.outputs.gem_version }}.gem
56+
57+
# extract the built layer from artifacts, then scan it with reverselab
58+
reverselab_scan_gem:
59+
needs:
60+
- publish_to_github_package
61+
runs-on: ubuntu-latest
62+
strategy:
63+
fail-fast: false
64+
65+
steps:
66+
- uses: actions/checkout@v4
67+
68+
- name: extract current solarwinds_apm version
69+
id: extract
70+
run: |
71+
APM_VERSION=$(ruby -e 'require "./lib/solarwinds_apm/version"; puts SolarWindsAPM::Version::STRING')
72+
echo "SOLARWINDS_APM_VERSION=$APM_VERSION" >> $GITHUB_ENV
73+
74+
- name: extract layer zip from artifacts
75+
uses: actions/download-artifact@v4
76+
with:
77+
name: solarwinds_apm-${{ env.SOLARWINDS_APM_VERSION }}.gem
78+
path: builds
79+
80+
- name: Scan build artifact on the Portal
81+
id: rl-scan
82+
env:
83+
RLPORTAL_ACCESS_TOKEN: ${{ secrets.REVERSE_LAB_TOKEN }}
84+
uses: reversinglabs/gh-action-rl-scanner-cloud-only@v1
85+
with:
86+
artifact-to-scan: builds/solarwinds_apm-${{ env.SOLARWINDS_APM_VERSION }}.gem
87+
rl-verbose: true
88+
rl-portal-server: solarwinds
89+
rl-portal-org: SolarWinds
90+
rl-portal-group: SaaS-Agents-SWO
91+
rl-package-url: solarwinds-apm-ruby/apm-ruby-stg@${{ env.SOLARWINDS_APM_VERSION }}
92+
93+
- name: report the scan status
94+
if: success() || failure()
95+
run: |
96+
echo "The status is: '${{ steps.rl-scan.outputs.status }}'"
97+
echo "The description is: '${{ steps.rl-scan.outputs.description }}'"

0 commit comments

Comments
 (0)