Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BST-12445: add main branch scan timeout #11

Merged
merged 4 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,15 @@ Optional path within the git repository to execute scanners in.

When this parameter is specified, you must also provide a `scan_label` to identify the component.

### `scan_timeout` (Optional, number)
### `scan_timeout` (Optional, number) deprecated

The optional timeout after which the Github check will be marked as failed. This defaults to 120 seconds.

### `scan_diff_timeout` (Optional, number)

The optional timeout on a diff scan after which the Github check will be marked as failed. This defaults to 120 seconds.

### `scan_main_timeout` (Optional, number)

The optional timeout on a main scan after which the Github check will be marked as failed. This defaults to 2 hours.

10 changes: 9 additions & 1 deletion action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,14 @@ inputs:
description: "Optional relative path to scan"
default: ""
scan_timeout:
description: "Maximum amount of time a diff scan should complete in (deprecated)"
default: ""
scan_diff_timeout:
description: "Maximum amount of time a diff scan should complete in"
default: ""
scan_main_timeout:
description: "Maximum amount of time a main scan should complete in"
default: ""
runs:
using: "composite"
steps:
Expand All @@ -59,7 +65,9 @@ runs:
BOOST_GIT_MAIN_BRANCH: ${{ inputs.main_branch }}
BOOST_IGNORE_FAILURE: ${{ inputs.ignore_failure }}
BOOST_LOG_LEVEL: ${{ inputs.log_level }}
BOOST_DIFF_SCAN_TIMEOUT: ${{ inputs.scan_timeout }}
BOOST_SCAN_TIMEOUT: ${{ inputs.scan_timeout }}
BOOST_DIFF_SCAN_TIMEOUT: ${{ inputs.scan_diff_timeout }}
BOOST_MAIN_SCAN_TIMEOUT: ${{ inputs.scan_main_timeout }}
BOOST_PRE_SCAN: ${{ inputs.pre_scan_cmd }}
BOOST_SCAN_LABEL: ${{ inputs.scan_label }}
BOOST_SCAN_PATH: ${{ inputs.scan_path }}
Expand Down
2 changes: 2 additions & 0 deletions lib/scan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ init.config ()
{
log.info "initializing configuration"

export BOOST_DIFF_SCAN_TIMEOUT=${BOOST_DIFF_SCAN_TIMEOUT:-${BOOST_SCAN_TIMEOUT:-}}

export BOOST_TMP_DIR=${BOOST_TMP_DIR:-${WORKSPACE_TMP:-${TMPDIR:-/tmp}}}
export BOOST_EXE=${BOOST_EXE:-${BOOST_TMP_DIR}/boost-cli/latest}

Expand Down
Loading