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
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ See [LICENSE](./LICENSE).

**Optional** Continue workflow execution even if scan fails. Default: `true`

#### `snapshotLabel`

**Optional** Label to identify the snapshot published on the Embold UI after a successful scan. Accepts a plain string or an environment variable (e.g., `$GITHUB_SHA` or `$GITHUB_REF_NAME`). Default: `` (empty — no label)

## Outputs

#### `status`
Expand Down Expand Up @@ -143,6 +147,7 @@ jobs:
repositoryConfigPath: repository-configuration.json
verbose: true
qualityGate: 'true'
snapshotLabel: ${{ github.ref_name }}-${{ github.sha }}
```

## Prerequisites
Expand Down
12 changes: 11 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ inputs:
description: 'Continue workflow execution even if scan fails'
required: false
default: 'true'
snapshotLabel:
description: 'Label to identify the snapshot published on Embold UI after a successful scan. Accepts a plain string or an environment variable.'
required: false
default: ''
outputs:
status:
description: 'Status of the scan'
Expand Down Expand Up @@ -95,6 +99,11 @@ runs:
QG_FLAG="-qg"
fi

SNAPSHOT_FLAG=""
if [ -n "${{ inputs.snapshotLabel }}" ]; then
SNAPSHOT_FLAG="-s \"${{ inputs.snapshotLabel }}\""
fi

./browserstack-codequality-scanner/bin/embold-scanner analyse \
-u "${{ inputs.emboldUrl }}" \
-t "$EMBOLD_TOKEN" \
Expand All @@ -103,7 +112,8 @@ runs:
-d "${{ inputs.tempDirectory }}" \
-b "${{ inputs.baseDirectory }}" \
$VERBOSE_FLAG \
$QG_FLAG
$QG_FLAG \
$SNAPSHOT_FLAG

- name: Get Quality Gate Status
if: ${{ inputs.qualityGate == 'true' }}
Expand Down
Loading