How to tag a scan in Pynt

Adding tags to your Pynt scans allows for better organization and traceability. These tags are visible in the Pynt Dashboard and can help identify scans based on context, such as the current Git commit or branch.

Using the Pynt CLI to Add Tags

To tag a scan, use the --tag option with your Pynt CLI command. You can add multiple tags by repeating the --tag option.

Example 1: Add the Current Git Short Hash as a Tag

You can include the current Git commit hash as a tag to track the scan's association with a specific code state.

pynt [COMMAND] [OPTIONS] --tag $(git rev-parse --short HEAD)

In this example:

  • $(git rev-parse --short HEAD) dynamically retrieves the short hash of the current Git commit.

  • The hash is added as a tag to the scan.

Example 2: Add the Git Branch Name as a Tag

Similarly, you can tag a scan with the name of the current Git branch to reflect the source branch of the code.

pynt [COMMAND] [OPTIONS] --tag $(git rev-parse --abbrev-ref HEAD)

In this example:

  • $(git rev-parse --abbrev-ref HEAD) retrieves the name of the current branch.

  • The branch name is added as a tag to the scan.

General Syntax

pynt [COMMAND] [OPTIONS] --tag <tag> --tag <another-tag>
  • [COMMAND]: The specific Pynt command you wish to execute.

  • [OPTIONS]: Additional options for the command.

  • <tag>: The tag you wish to add. Replace with a meaningful label or value.

You can add multiple tags by including the --tag option multiple times. All tags will be displayed in the Pynt Dashboard.

Viewing Tags in the Pynt Dashboard

After running a scan with tags:

  1. Go to the Scans History section in the Pynt Dashboard.

  2. Locate the relevant scan in the scan history.

  3. Tags will be displayed alongside the scan details.

Additionally, you can view the tags in the Last Scan area of the application page.

Using tags effectively can greatly enhance your ability to organize and track scans in Pynt.

Last updated