1111 token :
1212 required : true
1313 type : string
14+ event_name :
15+ required : true
16+ type : string
17+ build_runs_on :
18+ required : true
19+ type : string
20+ build_packager_image :
21+ required : true
22+ type : string
23+ build_predependency_command :
24+ required : true
25+ type : string
26+ ruby_version :
27+ required : true
28+ type : string
29+ bundle_version :
30+ required : true
31+ type : string
32+
1433jobs :
1534 build :
16- runs-on : ubuntu-latest
35+ runs-on : ${{ fromJSON(inputs.build_runs_on) }}
1736 container :
18- image : veracode/scm-packaging:2.1.0
37+ image : ${{ inputs.build_packager_image }}
1938 env :
2039 VERACODE_API_KEY_ID : ' ${{ secrets.VERACODE_API_ID }}'
2140 VERACODE_API_KEY_SECRET : ' ${{ secrets.VERACODE_API_KEY }}'
@@ -32,19 +51,37 @@ jobs:
3251
3352 - name : Package the application
3453 id : application_package
54+ shell : bash
3555 env :
3656 VERACODE_API_KEY_ID : ' ${{ secrets.VERACODE_API_ID }}'
3757 VERACODE_API_KEY_SECRET : ' ${{ secrets.VERACODE_API_KEY }}'
3858 run : |
59+ if [[ ! -z "${{ inputs.build_predependency_command }}" ]]; then
60+ echo "Executing Pre-Build Dependency.."
61+ ${{ inputs.build_predependency_command }}
62+ else
63+ echo "No Pre-Build Dependency provided."
64+ fi
65+ if [[ "${{ inputs.event_name }}" == *"ruby"* ]]; then
66+ source /etc/profile.d/rvm.sh
67+ rvm pkg install openssl
68+ rvm install ruby-${{ inputs.ruby_version }}
69+ fi
70+ working_path=`pwd`
71+ echo "working_dir=$working_path" >> "$GITHUB_OUTPUT"
3972 cd veracode-helper/helper/cli
4073 cliFile=$(ls -1 . | head -n 1)
4174 cliFileName=$(echo "$cliFile" | cut -c 1-$((${#cliFile}-7)))
4275 tar -zxvf $cliFile
4376 cd $cliFileName
4477 export PATH="veracode-helper/helper/cli/$cliFileName:$PATH"
45- cd /__w/veracode/veracode
78+ cd $working_path
79+ if [[ "${{ inputs.event_name }}" == *"ruby"* ]]; then
80+ gem install bundler -v ${{ inputs.bundle_version }}
81+ gem install veracode
82+ bundle install
83+ fi
4684 veracode package --source . --output veracode-artifacts --trust
47- zip veracode-artifact.zip veracode-artifacts/* -x .zip .tar .tar.gz .gz
4885
4986 - name : Package error
5087 if : failure() && steps.application_package.outcome == 'failure'
5491 - uses : actions/upload-artifact@v4
5592 with :
5693 name : veracode-artifact
57- path : /__w/ veracode/veracode/veracode -artifacts/*
58- if-no-files-found : error
94+ path : " ${{ steps.application_package.outputs.working_dir }}/ veracode-artifacts/*"
95+ if-no-files-found : error
0 commit comments