Skip to content

Commit

Permalink
File restructuring (#14)
Browse files Browse the repository at this point in the history
Co-authored-by: Dhruv Singhal <[email protected]/>
  • Loading branch information
dhruv-singhal-github and Dhruv Singhal authored Oct 27, 2022
1 parent f933bd0 commit 99f7b46
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
client_scan_token: ${{ secrets.CLIENT_SCAN_TOKEN_DEMO }}
cli_version: '1.0.0-rc.3'
traffic_env: 'crapi-demo1'
include_url_regex: 13.58.254.175
include_url_regex: '13.58.254.175'
traceable_server: ${{ secrets.TRACEABLE_SERVER_DEMO }}
- name: Stop Scan
if: always()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
client_scan_token: ${{ secrets.CLIENT_SCAN_TOKEN }}
traffic_env: 'samarth-crapi'
traceable_server: ${{ secrets.TRACEABLE_SERVER }}
traceable_cli_download_path: https://downloads.traceable.ai/cli/rc/latest/traceable-cli-latest-linux-x86_64.tar.gz
- name: Run a loop as functional test
run: |
for ((i=1;i<=100;i++));
Expand Down
30 changes: 20 additions & 10 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ inputs:
required: true
description: ''
default: 'NULL'
traceable_cli_download_path:
required: false
description: ''
default: 'NULL'
cli_version:
required: false
description: ''
Expand Down Expand Up @@ -79,15 +83,21 @@ runs:
- name: Download CLI
if: ${{ inputs.step_name == 'init' || inputs.step_name == 'init and run' }}
run: |
if [[ "${{ inputs.cli_version }}" = *"-rc."* ]]
then
curl -OL https://downloads.traceable.ai/cli/rc/${{ inputs.cli_version }}/tars/traceable-cli-${{ inputs.cli_version }}-linux-x86_64.tar.gz
fi
if [[ "${{ inputs.cli_version }}" = "latest" ]]
if [[ "${{ inputs.traceable_cli_download_path }}" != "NULL" ]]
then
curl -OL https://downloads.traceable.ai/cli/rc/${{ inputs.cli_version }}/traceable-cli-${{ inputs.cli_version }}-linux-x86_64.tar.gz
curl -Lo traceableCli.tar.gz ${{ inputs. traceable_cli_download_path }}
tar -xvf traceableCli.tar.gz --directory ${GITHUB_WORKSPACE}
else
if [[ "${{ inputs.cli_version }}" = *"-rc."* ]]
then
curl -OL https://downloads.traceable.ai/cli/rc/${{ inputs.cli_version }}/tars/traceable-cli-${{ inputs.cli_version }}-linux-x86_64.tar.gz
fi
if [[ "${{ inputs.cli_version }}" = "latest" ]]
then
curl -OL https://downloads.traceable.ai/cli/rc/${{ inputs.cli_version }}/traceable-cli-${{ inputs.cli_version }}-linux-x86_64.tar.gz
fi
tar -xvf ${GITHUB_WORKSPACE}/traceable-cli-${{ inputs.cli_version }}-linux-x86_64.tar.gz --directory ${GITHUB_WORKSPACE}
fi
tar -xvf ${GITHUB_WORKSPACE}/traceable-cli-${{ inputs.cli_version }}-linux-x86_64.tar.gz --directory ${GITHUB_WORKSPACE}
shell: bash
- name: Init and run command on cli
if: ${{ inputs.step_name == 'init and run' }}
Expand Down Expand Up @@ -118,7 +128,7 @@ runs:
#Iterating the options available from options array and filling them with the arguments received in order
iterator=0
for option in ${{ inputs.scan_name }} ${{ inputs.traffic_env }} ${{ inputs.client_scan_token }} ${{ inputs.plugins }} ${{ inputs.include_url_regex }} ${{ inputs.exclude_url_regex }} ${{ inputs.target_url }} ${{ inputs.traceable_server }} ${{ inputs.idle_timeout }} ${{ inputs.scan_timeout }} ${{ inputs.reference_env }} ${{ inputs.max_retries }}
for option in '${{ inputs.scan_name }}' '${{ inputs.traffic_env }}' '${{ inputs.client_scan_token }}' '${{ inputs.plugins }}' "${{ inputs.include_url_regex }}" "${{ inputs.exclude_url_regex }}" '${{ inputs.target_url }}' '${{ inputs.traceable_server }}' '${{ inputs.idle_timeout }}' '${{ inputs.scan_timeout }}' '${{ inputs.reference_env }}' '${{ inputs.max_retries }}'
do
if [ -z "$option" ] || [ "$option" = "''" ] || [ "$option" = "NULL" ]
then
Expand Down Expand Up @@ -162,7 +172,7 @@ runs:
#Iterating the options available from options array and filling them with the arguments received in order
iterator=0
for option in ${{ inputs.scan_name }} ${{ inputs.traffic_env }} ${{ inputs.client_scan_token }} ${{ inputs.plugins }} ${{ inputs.include_url_regex }} ${{ inputs.exclude_url_regex }} ${{ inputs.target_url }} ${{ inputs.traceable_server }} ${{ inputs.scan_timeout }} ${{ inputs.reference_env }}
for option in '${{ inputs.scan_name }}' '${{ inputs.traffic_env }}' '${{ inputs.client_scan_token }}' '${{ inputs.plugins }}' "${{ inputs.include_url_regex }}" "${{ inputs.exclude_url_regex }}" '${{ inputs.target_url }}' '${{ inputs.traceable_server }}' '${{ inputs.scan_timeout }}' '${{ inputs.reference_env }}'
do
if [ -z "$option" ] || [ "$option" = "''" ] || [ "$option" = "NULL" ]
then
Expand Down Expand Up @@ -201,7 +211,7 @@ runs:
#Iterating the options available from options array and filling them with the arguments received in order
iterator=0
for option in ${{ inputs.client_scan_token }} ${{ inputs.idle_timeout }} ${{ inputs.max_retries }}
for option in '${{ inputs.client_scan_token }}' '${{ inputs.idle_timeout }}' '${{ inputs.max_retries }}'
do
if [ -z "$option" ] || [ "$option" = "''" ] || [ "$option" = "NULL" ]
then
Expand Down

0 comments on commit 99f7b46

Please sign in to comment.