Skip to content

Commit

Permalink
feat: add title option to level card
Browse files Browse the repository at this point in the history
  • Loading branch information
devfle committed Apr 9, 2023
1 parent 8479e4b commit 6884e22
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ inputs:
description: 'If true, shows an pre element with all ep information'
required: false
default: true
card_title:
description: 'The title of the level up card'
required: false
default: 'My Github level 🎊'

runs:
using: 'composite'
Expand All @@ -53,6 +57,7 @@ runs:
INPUT_FILLED_BAR: ${{ inputs.filled_bar }}
INPUT_README_PATH: ${{ inputs.readme_path }}
INPUT_SHOW_EP_INFO: ${{ inputs.show_ep_info }}
INPUT_CARD_TITLE: ${{ inputs.card_title }}

branding:
icon: 'arrow-up-circle'
Expand Down
1 change: 1 addition & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def draw_progress_bar(current_progress: float | int) -> str:
end_section: str = "<!--README_LEVEL_UP:END-->"
search_pattern: str = fr"{start_section}[\s\S]*?{end_section}"
replace_str: str = (f"{start_section}\n"
f"{ getenv('INPUT_CARD_TITLE') if getenv('INPUT_CARD_TITLE') else '' } \n"
f"<pre>level: { user_level } { draw_progress_bar(to_next_lvl) } {round(to_next_lvl, 2)}%</pre>\n"
f"{ ep_information if getenv('INPUT_SHOW_EP_INFO') else '' }"
f"{end_section}")
Expand Down

0 comments on commit 6884e22

Please sign in to comment.