From 9542bac9d03e4b7efae3e1042f413edf8c7aff5a Mon Sep 17 00:00:00 2001 From: Nilesh Date: Wed, 18 Mar 2026 12:28:21 +0530 Subject: [PATCH] CQ-1141 : Added option snapshot label in GitHub action --- README.md | 5 +++++ action.yml | 12 +++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a4d8fce..3d1812d 100644 --- a/README.md +++ b/README.md @@ -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` @@ -143,6 +147,7 @@ jobs: repositoryConfigPath: repository-configuration.json verbose: true qualityGate: 'true' + snapshotLabel: ${{ github.ref_name }}-${{ github.sha }} ``` ## Prerequisites diff --git a/action.yml b/action.yml index ed52e1a..2a395eb 100644 --- a/action.yml +++ b/action.yml @@ -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' @@ -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" \ @@ -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' }}