Skip to content

Commit 7a15e21

Browse files
committed
Capture variable in workflow dipatch and use in code.
1 parent f981893 commit 7a15e21

File tree

3 files changed

+300
-42
lines changed

3 files changed

+300
-42
lines changed

.github/workflows/manual-job.yml

+6-5
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,15 @@ name: download_letcode_manual
33
on:
44
workflow_dispatch:
55
inputs:
6-
numberOfProblems:
6+
MAXIMUM_NUMBER_OF_PROBLEMS:
77
description: 'Number of problems to download'
88
default: '30'
9-
sleepTimePerProblemInSecond:
9+
SLEEP_TIME_PER_PROBLEM_IN_SECOND:
1010
description: 'Number of seconds to wait after downloading each problem'
1111

1212
jobs:
1313
build:
14-
1514
runs-on: ubuntu-latest
16-
1715
steps:
1816
- uses: actions/checkout@v2
1917
- name: Set up Python 3.7
@@ -27,9 +25,12 @@ jobs:
2725
- name: Generate epub and html
2826
run: |
2927
python main.py
28+
env:
29+
MAXIMUM_NUMBER_OF_PROBLEMS: ${{ github.event.inputs.MAXIMUM_NUMBER_OF_PROBLEMS }}
30+
SLEEP_TIME_PER_PROBLEM_IN_SECOND: ${{ github.event.inputs.SLEEP_TIME_PER_PROBLEM_IN_SECOND }}
3031
- name: Commit and push
3132
run: |-
3233
git config --global user.email "githubaction@example.com"
3334
git config --global user.name "github-action"
3435
git diff --quiet || (git add chapters.pickle out.html track.conf "Leetcode Questions.epub" && git commit -m "Update with new problems")
35-
git push origin HEAD:main
36+
git push --force-with-lease

.gitignore

+251
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,251 @@
1+
2+
# Created by https://www.toptal.com/developers/gitignore/api/python,intellij
3+
# Edit at https://www.toptal.com/developers/gitignore?templates=python,intellij
4+
5+
### Intellij ###
6+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
7+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
8+
.idea
9+
# User-specific stuff
10+
.idea/**/workspace.xml
11+
.idea/**/tasks.xml
12+
.idea/**/usage.statistics.xml
13+
.idea/**/dictionaries
14+
.idea/**/shelf
15+
16+
# AWS User-specific
17+
.idea/**/aws.xml
18+
19+
# Generated files
20+
.idea/**/contentModel.xml
21+
22+
# Sensitive or high-churn files
23+
.idea/**/dataSources/
24+
.idea/**/dataSources.ids
25+
.idea/**/dataSources.local.xml
26+
.idea/**/sqlDataSources.xml
27+
.idea/**/dynamic.xml
28+
.idea/**/uiDesigner.xml
29+
.idea/**/dbnavigator.xml
30+
31+
# Gradle
32+
.idea/**/gradle.xml
33+
.idea/**/libraries
34+
35+
# Gradle and Maven with auto-import
36+
# When using Gradle or Maven with auto-import, you should exclude module files,
37+
# since they will be recreated, and may cause churn. Uncomment if using
38+
# auto-import.
39+
# .idea/artifacts
40+
# .idea/compiler.xml
41+
# .idea/jarRepositories.xml
42+
# .idea/modules.xml
43+
# .idea/*.iml
44+
# .idea/modules
45+
# *.iml
46+
# *.ipr
47+
48+
# CMake
49+
cmake-build-*/
50+
51+
# Mongo Explorer plugin
52+
.idea/**/mongoSettings.xml
53+
54+
# File-based project format
55+
*.iws
56+
57+
# IntelliJ
58+
out/
59+
60+
# mpeltonen/sbt-idea plugin
61+
.idea_modules/
62+
63+
# JIRA plugin
64+
atlassian-ide-plugin.xml
65+
66+
# Cursive Clojure plugin
67+
.idea/replstate.xml
68+
69+
# Crashlytics plugin (for Android Studio and IntelliJ)
70+
com_crashlytics_export_strings.xml
71+
crashlytics.properties
72+
crashlytics-build.properties
73+
fabric.properties
74+
75+
# Editor-based Rest Client
76+
.idea/httpRequests
77+
78+
# Android studio 3.1+ serialized cache file
79+
.idea/caches/build_file_checksums.ser
80+
81+
### Intellij Patch ###
82+
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
83+
84+
# *.iml
85+
# modules.xml
86+
# .idea/misc.xml
87+
# *.ipr
88+
89+
# Sonarlint plugin
90+
# https://plugins.jetbrains.com/plugin/7973-sonarlint
91+
.idea/**/sonarlint/
92+
93+
# SonarQube Plugin
94+
# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin
95+
.idea/**/sonarIssues.xml
96+
97+
# Markdown Navigator plugin
98+
# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced
99+
.idea/**/markdown-navigator.xml
100+
.idea/**/markdown-navigator-enh.xml
101+
.idea/**/markdown-navigator/
102+
103+
# Cache file creation bug
104+
# See https://youtrack.jetbrains.com/issue/JBR-2257
105+
.idea/$CACHE_FILE$
106+
107+
# CodeStream plugin
108+
# https://plugins.jetbrains.com/plugin/12206-codestream
109+
.idea/codestream.xml
110+
111+
### Python ###
112+
# Byte-compiled / optimized / DLL files
113+
__pycache__/
114+
*.py[cod]
115+
*$py.class
116+
117+
# C extensions
118+
*.so
119+
120+
# Distribution / packaging
121+
.Python
122+
build/
123+
develop-eggs/
124+
dist/
125+
downloads/
126+
eggs/
127+
.eggs/
128+
lib/
129+
lib64/
130+
parts/
131+
sdist/
132+
var/
133+
wheels/
134+
share/python-wheels/
135+
*.egg-info/
136+
.installed.cfg
137+
*.egg
138+
MANIFEST
139+
140+
# PyInstaller
141+
# Usually these files are written by a python script from a template
142+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
143+
*.manifest
144+
*.spec
145+
146+
# Installer logs
147+
pip-log.txt
148+
pip-delete-this-directory.txt
149+
150+
# Unit test / coverage reports
151+
htmlcov/
152+
.tox/
153+
.nox/
154+
.coverage
155+
.coverage.*
156+
.cache
157+
nosetests.xml
158+
coverage.xml
159+
*.cover
160+
*.py,cover
161+
.hypothesis/
162+
.pytest_cache/
163+
cover/
164+
165+
# Translations
166+
*.mo
167+
*.pot
168+
169+
# Django stuff:
170+
*.log
171+
local_settings.py
172+
db.sqlite3
173+
db.sqlite3-journal
174+
175+
# Flask stuff:
176+
instance/
177+
.webassets-cache
178+
179+
# Scrapy stuff:
180+
.scrapy
181+
182+
# Sphinx documentation
183+
docs/_build/
184+
185+
# PyBuilder
186+
.pybuilder/
187+
target/
188+
189+
# Jupyter Notebook
190+
.ipynb_checkpoints
191+
192+
# IPython
193+
profile_default/
194+
ipython_config.py
195+
196+
# pyenv
197+
# For a library or package, you might want to ignore these files since the code is
198+
# intended to run in multiple environments; otherwise, check them in:
199+
# .python-version
200+
201+
# pipenv
202+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
203+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
204+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
205+
# install all needed dependencies.
206+
#Pipfile.lock
207+
208+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
209+
__pypackages__/
210+
211+
# Celery stuff
212+
celerybeat-schedule
213+
celerybeat.pid
214+
215+
# SageMath parsed files
216+
*.sage.py
217+
218+
# Environments
219+
.env
220+
.venv
221+
env/
222+
venv/
223+
ENV/
224+
env.bak/
225+
venv.bak/
226+
227+
# Spyder project settings
228+
.spyderproject
229+
.spyproject
230+
231+
# Rope project settings
232+
.ropeproject
233+
234+
# mkdocs documentation
235+
/site
236+
237+
# mypy
238+
.mypy_cache/
239+
.dmypy.json
240+
dmypy.json
241+
242+
# Pyre type checker
243+
.pyre/
244+
245+
# pytype static type analyzer
246+
.pytype/
247+
248+
# Cython debug symbols
249+
cython_debug/
250+
251+
# End of https://www.toptal.com/developers/gitignore/api/python,intellij

0 commit comments

Comments
 (0)