Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v9
with:
# Version omitted to use action's default (tracks Go compatibility)
version: v2.10.1
args: --timeout=5m

# Posts a sticky coverage comment to PRs (updates in place, details collapsed)
Expand Down
25 changes: 19 additions & 6 deletions .github/workflows/reusable-security-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ on:
type: string
default: '.'
fail-on:
description: 'Comma-separated severity levels to fail on (e.g., HIGH,CRITICAL)'
description: 'Comma-separated severity levels to fail on (e.g., HIGH,CRITICAL). Empty string for informational mode (never fail).'
type: string
default: 'CRITICAL'
default: ''
pr-comment:
description: 'Post scan results as PR comment'
type: boolean
Expand Down Expand Up @@ -273,16 +273,29 @@ jobs:
RESULTS_COUNT: ${{ steps.scan_analysis.outputs.results_count }}
FAIL_ON: ${{ inputs.fail-on }}
run: |
# First, check for operational failures (timeout, API errors, etc.)
# These should always fail regardless of informational mode
if [ "$SCAN_OUTCOME" = "failure" ] || [ "$SCAN_OUTCOME" = "cancelled" ]; then
if [ "$HAS_RESULTS" = "false" ] || [ "${RESULTS_COUNT:-0}" = "0" ]; then
# Scan failed without producing results - likely timeout or API error
echo "::error::Armis scan failed (timeout, API error, or other issue). Check the 'Run Armis Security Scan' step for details."
exit 1
else
# Scan completed but found vulnerabilities above threshold
echo "::error::Security vulnerabilities detected by Armis (threshold: $FAIL_ON). Found $RESULTS_COUNT issues."
exit 1
fi
# Scan produced results but step marked as failure - findings exceeded threshold
# Fall through to threshold check below
fi

# Informational mode: if fail-on is empty, never fail on findings
# (but operational failures above are still caught)
if [ -z "$FAIL_ON" ]; then
echo "Scan completed in informational mode (no fail-on threshold). Found ${RESULTS_COUNT:-0} issues."
exit 0
fi

# Check if findings exceeded threshold
if [ "$SCAN_OUTCOME" = "failure" ]; then
echo "::error::Security vulnerabilities detected by Armis (threshold: $FAIL_ON). Found $RESULTS_COUNT issues."
exit 1
fi

echo "Scan completed successfully with no issues above threshold."
5 changes: 5 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,8 @@ linters:
- gosec
- goconst
- misspell
settings:
staticcheck:
checks:
- "all"
- "-QF1012" # WriteString(fmt.Sprintf) style suggestion - not a bug
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These golangci-lint configuration changes appear unrelated to the PR's stated purpose of fixing empty fail-on support for informational mode. These changes should be moved to a separate PR focused on linter configuration to keep changes focused and easier to review.

Suggested change
- "-QF1012" # WriteString(fmt.Sprintf) style suggestion - not a bug

Copilot uses AI. Check for mistakes.
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ inputs:
required: false
default: 'sarif'
fail-on:
description: 'Comma-separated severity levels to fail on (e.g., HIGH,CRITICAL)'
description: 'Comma-separated severity levels to fail on (e.g., HIGH,CRITICAL). Empty string for informational mode (never fail).'
required: false
default: 'CRITICAL'
default: ''
exit-code:
description: 'Exit code to return when build fails'
required: false
Expand Down