Skip to content

Commit c332c94

Browse files
Merge pull request #176 from nathanielvarona/improvement-step-outputs-logs-formating
Step Outputs Logs Formating
2 parents 986248c + 22b4714 commit c332c94

File tree

2 files changed

+26
-11
lines changed

2 files changed

+26
-11
lines changed

README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -92,18 +92,18 @@ Configure the **Pritunl Client GitHub Action** using a declarative syntax, makin
9292

9393
* `client-id` — a string representing the primary client ID, which is a single identifier generated during the profile setup process.
9494
- Example:
95-
```
96-
client_id="6p5yiqbkjbktkrz5"
95+
```text
96+
6p5yiqbkjbktkrz5
9797
```
9898
* `client-ids` — a JSON array containing all client IDs and names in the profile, with each entry represented as a key-value pair (e.g., `{"id":"client_id","name":"profile_name"}`).
9999
100100
- Example _(single entry)_:
101-
```
102-
client-ids="[{"id":"6p5yiqbkjbktkrz5","name":"gha-automator-dev (dev-team)"}]"
101+
```json
102+
[{"id":"6p5yiqbkjbktkrz5","name":"gha-automator-dev (dev-team)"}]
103103
```
104104
- Example _(multiple entries)_:
105-
```
106-
client-ids="[{"id":"kp4kx4zbcqpsqkbk","name":"gha-automator-qa2 (dev-team)"},{"id":"rsy6npzw5mwryge2","name":"gha-automator-qa2 (qa-team)"}]"
105+
```json
106+
[{"id":"kp4kx4zbcqpsqkbk","name":"gha-automator-qa2 (dev-team)"},{"id":"rsy6npzw5mwryge2","name":"gha-automator-qa2 (qa-team)"}]
107107
```
108108
109109

pritunl-client.sh

+20-5
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@ PRITUNL_CONCEALED_OUTPUTS="${PRITUNL_CONCEALED_OUTPUTS:-}" # Concealed Outputs
2626

2727
# Visual Feedback with Emoji Bytes and Color Codes
2828
# ---------------------------------------------------------------
29+
# Emojis
2930
TTY_EMOJI_PACKAGE='\xF0\x9F\x93\xA6' # Package emoji
3031
TTY_EMOJI_SCROLL='\xF0\x9F\x93\x9C' # Scroll emoji
32+
# Color Codes
3133
TTY_RED_NORMAL='\033[0;31m' # Normal red color
3234
TTY_RED_BOLD='\033[1;31m' # Bold red color
3335
TTY_GREEN_NORMAL='\033[0;32m' # Normal green color
@@ -36,10 +38,13 @@ TTY_YELLOW_NORMAL='\033[0;33m' # Normal yellow color
3638
TTY_YELLOW_BOLD='\033[1;33m' # Bold yellow color
3739
TTY_BLUE_NORMAL='\033[0;34m' # Normal blue color
3840
TTY_BLUE_BOLD='\033[1;34m' # Bold blue color
41+
# Gray Colors
42+
TTY_GRAY_NORMAL='\033[0;37m' # Normal gray color
43+
TTY_GRAY_BOLD='\033[1;90m' # Bold gray color
44+
# Color Reset
3945
TTY_COLOR_RESET='\033[0m' # Reset terminal color
4046
# ---------------------------------------------------------------
4147

42-
4348
# Installation process for Linux
4449
install_for_linux() {
4550
# This function contains code to install the Pritunl client on Linux.
@@ -365,11 +370,21 @@ setup_profile_file() {
365370
echo -e "${TTY_EMOJI_SCROLL} The profile has been configured, ${TTY_BLUE_NORMAL}step outputs${TTY_COLOR_RESET} generated, and profile $(pluralize_word $profile_server_count "server") are now ready for connection establishment."
366371

367372
if [[ "${PRITUNL_CONCEALED_OUTPUTS}" != "true" ]]; then
368-
# Display Primary Client ID (string, bash variable)
369-
echo -e "${TTY_BLUE_NORMAL}client-id${TTY_COLOR_RESET}=\"${TTY_GREEN_NORMAL}$client_id${TTY_COLOR_RESET}\""
373+
# Display header with yellow color
374+
echo -e "${TTY_YELLOW_NORMAL}Action Step Outputs${TTY_COLOR_RESET}"
375+
# Display horizontal rule with gray color, separating header from content
376+
echo -e "${TTY_GRAY_NORMAL}-------------------${TTY_COLOR_RESET}"
377+
378+
# Display Primary Client ID (string, bash variable) with blue and green colors
379+
# client-id is displayed in blue, followed by the actual ID in green
380+
echo -e "${TTY_BLUE_NORMAL}client-id${TTY_COLOR_RESET}: ${TTY_GREEN_NORMAL}$client_id${TTY_COLOR_RESET}"
381+
382+
# Display All Client IDs and Names (JSON array) with blue color
383+
# client-ids is displayed in blue, followed by the JSON array of IDs and names
384+
echo -e "${TTY_BLUE_NORMAL}client-ids${TTY_COLOR_RESET}: $(echo $client_ids | jq -cC )"
370385

371-
# Display All Client IDs and Names (JSON array)
372-
echo -e "${TTY_BLUE_NORMAL}client-ids${TTY_COLOR_RESET}=\"$(echo $client_ids | jq -cC )\""
386+
# Display horizontal rule with gray color, separating content from footer
387+
echo -e "${TTY_GRAY_NORMAL}-------------------${TTY_COLOR_RESET}"
373388
else
374389
echo -e "${TTY_YELLOW_NORMAL}Step outputs are concealed. Set 'concealed-outputs' to 'false' in the action inputs to reveal.${TTY_COLOR_RESET}"
375390
fi

0 commit comments

Comments
 (0)