Skip to content

Commit

Permalink
add workflow with suite
Browse files Browse the repository at this point in the history
  • Loading branch information
yogesh-gogia1 committed May 31, 2024
1 parent c527a5a commit 3c2533d
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 17 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/test-traceable-ast-init-and-run-with-suite.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Test Traceable AST Init And Run Action with AST Scan Suite
on:
push:
branches:
- main
pull_request:
workflow_dispatch:

jobs:
InitAndRunAstScan:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Init and run scan action
uses: Traceableai/ast-action@main
with:
step_name: 'init and run'
client_scan_token: ${{ secrets.CLIENT_SCAN_TOKEN_DEMO }}
cli_version: 'latest'
suite_name: 'crapi-github-actions-suite'
traffic_env: 'crapi-demo1'
traceable_server: ${{ secrets.TRACEABLE_SERVER_DEMO }}
- name: Stop Scan
if: always()
uses: Traceableai/ast-action@main
with:
step_name: 'stop'
client_scan_token: ${{ secrets.CLIENT_SCAN_TOKEN_DEMO }}
traffic_env: 'crapi-demo1'
traceable_server: ${{ secrets.TRACEABLE_SERVER_DEMO }}
functionalTest:
runs-on: ubuntu-20.04
steps:
- name: Run a loop as functional test
run: |
for ((i=1;i<=100;i++));
do
echo $i
done
36 changes: 20 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,26 @@ Traceable’s GitHub action can be used to continuously test your software build
## Getting started with Traceable AST action
### Understanding the inputs

| **Input** | **Description** |
| ------------------- |--------------------------------------------------------------------|
| step\_name | Scan action: init/ run/ init and run/ stop. |
| scan\_name | Name of the scan |
| client\_scan\_token | Access token from platform |
| cli\_version | Version of CLI you want to use for AST. Current one is 1.0.0-rc.3. |
| traffic\_env | Environment from where AST should observe traffic. |
| plugins | List of plugins you want to run the AST scan for. |
| include\_url\_regex | Include URL patterns to test. |
| exclude\_url\_regex | exclude URL patterns from scan. |
| target\_url | Target URL for the tests. |
| traceable\_server | URL for traceable server, not applicable for SaaS customers. |
| idle\_timeout | Scan timeout for a scan when it goes in IDLE state. |
| scan\_timeout | Scan timeout in general. |
| reference\_env | Reference environment from where AST should pick up the API specs. |
| max\_retries | Max retries for the scan after failure. |
| **Input** | **Description** |
|---------------------------------|-------------------------------------------------------------------------------|
| step\_name | Scan action: init/ run/ init and run/ stop. |
| scan\_name | Name of the scan |
| client\_scan\_token | Access token from platform |
| cli\_version | Version of CLI you want to use for AST. Current one is 1.0.0-rc.3. |
| traffic\_env | Environment from where AST should observe traffic. |
| plugins | List of plugins you want to run the AST scan for. |
| include\_url\_regex | Include URL patterns to test. |
| exclude\_url\_regex | exclude URL patterns from scan. |
| target\_url | Target URL for the tests. |
| traceable\_server | URL for traceable server, not applicable for SaaS customers. |
| idle\_timeout | Scan timeout for a scan when it goes in IDLE state. |
| scan\_timeout | Scan timeout in general. |
| reference\_env | Reference environment from where AST should pick up the API specs. |
| max\_retries | Max retries for the scan after failure. |
| scan\_suite | AST suite name as defined on the Traceable.ai platform. |
| graphql\_schema\_ids | Comma separated GraphQl schema IDs uploaded on Traceable.ai platform. |
| graphql\_schema\_files | Comma separated GraphQl SDL file paths. |
| graphql\_introspection\_enabled | Enables extracting the GraphQl Schema by running introspection on target-url. |


### Sample GitHub Action workflow
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ inputs:
default: 'NULL'
graphql_schema_ids:
required: false
description: 'Comma separated GraphQl schema IDs updated on Traceable.ai platform'
description: 'Comma separated GraphQl schema IDs uploaded on Traceable.ai platform'
default: 'NULL'
graphql_schema_files:
required: false
Expand Down

0 comments on commit 3c2533d

Please sign in to comment.