Skip to content

Commit

Permalink
Added username input
Browse files Browse the repository at this point in the history
  • Loading branch information
Zanger67 committed Jul 20, 2024
1 parent 69196da commit 06d15e0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
3 changes: 2 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ runs:
shell: bash
# -n: ignores previous .pkl stores of the modified dates (regenerate all from scratch)
# -g: use github log history to determine creation and modification dates of files
run: python '.readme_updater/main.py' -n -g
# -user: specify the username for the LeetCode account
run: python '.readme_updater/main.py' -n -g -user ${{ inputs.username }}


# Note: exit 0 should be redundant since this action triggers on a modification meaning
Expand Down
7 changes: 3 additions & 4 deletions main.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,11 @@
"outputs": [],
"source": [
"# loading env variables\n",
"print('Default .env activated from script directory (.readme_updater/)')\n",
"load_dotenv(find_dotenv(), override=True)\n",
"if '.env' in listdir('../') :\n",
" print('.env found in ../ directory')\n",
" print('.env found in ../ directory. Overriding default...')\n",
" load_dotenv(find_dotenv('../.env'), override=True)\n",
"else :\n",
" print('Default .env used from script directory (.readme_updater/)')\n",
" load_dotenv(find_dotenv(), override=True)\n",
"\n",
"# NOTE: if the script is being run from a jupyter notebook, then it should\n",
"# already be in the correct directory.\n",
Expand Down
7 changes: 3 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,11 @@


# loading env variables
print('Default .env activated from script directory (.readme_updater/)')
load_dotenv(find_dotenv(), override=True)
if '.env' in listdir('../') :
print('.env found in ../ directory')
print('.env found in ../ directory. Overriding default...')
load_dotenv(find_dotenv('../.env'), override=True)
else :
print('Default .env used from script directory (.readme_updater/)')
load_dotenv(find_dotenv(), override=True)

# NOTE: if the script is being run from a jupyter notebook, then it should
# already be in the correct directory.
Expand Down

0 comments on commit 06d15e0

Please sign in to comment.