# US1\_getResults.sh

This guide explains how to configure the `US1_getResults.sh` script to extract code-to-ticket information from Git and update your SeaLights TGA report.

***

### **Required Variables**

* **SEALIGHTS\_API\_TOKEN:** Your SeaLights API token (securely store it with a Secret Manager if possible).
* **DOMAIN:** Your SeaLights domain (e.g., `yourdomain.sealights.co`).
* **DAYS\_BACK:** Number of days back to analyze code changes (e.g., 30).
* **OUTPUT\_FOLDER:** Path where results will be saved (default is current directory).
* **KEY\_PATTERN\_REGEX:** Regular expression to match ticket IDs in Git commit comments (e.g., `JIRA-[0-9]+`).
* **HIGHEST\_PATTERN\_REGEX:** Keyword indicating critical code (default is `Critical`).
* **UPDATE\_LATEST\_TGA:** Set to `true` to update existing TGA reports with latest builds.
* **CREATE\_NOT\_EXIST\_TGA\_DAYS:** Days back to create TGA reports for missing apps.
* **APPLICATION\_LIST:** JSON array defining applications to analyze:
  * **appName:** Application name in SeaLights.
  * **branchName:** Branch name in SeaLights.
  * **base\_url:** SSH base URL for repos or components.
  * **repoName:** Repo name for single components (empty for integration builds).

### **Optional Variables**

* **GIT\_KEYFILE:** Path to a temporary Git SSH key file (if not using default SSH keys).
* **REPO\_MAP:** Map component names to different base URLs or repo names (uncomment and update if needed).

***

### **Customization and Tips**

* Update regular expressions according to your ticket ID format and critical code keywords.
* Consider environment variables for sensitive information like API tokens.
* Adjust `DAYS_BACK` and `CREATE_NOT_EXIST_TGA_DAYS` based on your data retention needs.
* Add more applications to the `APPLICATION_LIST` as needed.
* Modify the script logic and variables for specific workflows.
