Skip to content

Commit 4c0ba2f

Browse files
authored
Merge pull request #5 from embold/releases/2.0.0
CQ-1141 : Added option snapshot label in GitHub action
2 parents 1df03d9 + 139939c commit 4c0ba2f

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ See [LICENSE](./LICENSE).
5757

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

60+
#### `snapshotLabel`
61+
62+
**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)
63+
6064
## Outputs
6165

6266
#### `status`
@@ -143,6 +147,7 @@ jobs:
143147
repositoryConfigPath: repository-configuration.json
144148
verbose: true
145149
qualityGate: 'true'
150+
snapshotLabel: ${{ github.ref_name }}-${{ github.sha }}
146151
```
147152
148153
## Prerequisites

action.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ inputs:
4949
description: 'Continue workflow execution even if scan fails'
5050
required: false
5151
default: 'true'
52+
snapshotLabel:
53+
description: 'Label to identify the snapshot published on Embold UI after a successful scan. Accepts a plain string or an environment variable.'
54+
required: false
55+
default: ''
5256
outputs:
5357
status:
5458
description: 'Status of the scan'
@@ -95,6 +99,11 @@ runs:
9599
QG_FLAG="-qg"
96100
fi
97101
102+
SNAPSHOT_FLAG=""
103+
if [ -n "${{ inputs.snapshotLabel }}" ]; then
104+
SNAPSHOT_FLAG="-s \"${{ inputs.snapshotLabel }}\""
105+
fi
106+
98107
./browserstack-codequality-scanner/bin/embold-scanner analyse \
99108
-u "${{ inputs.emboldUrl }}" \
100109
-t "$EMBOLD_TOKEN" \
@@ -103,7 +112,8 @@ runs:
103112
-d "${{ inputs.tempDirectory }}" \
104113
-b "${{ inputs.baseDirectory }}" \
105114
$VERBOSE_FLAG \
106-
$QG_FLAG
115+
$QG_FLAG \
116+
$SNAPSHOT_FLAG
107117
108118
- name: Get Quality Gate Status
109119
if: ${{ inputs.qualityGate == 'true' }}

0 commit comments

Comments
 (0)