File tree Expand file tree Collapse file tree 2 files changed +40
-0
lines changed
Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Original file line number Diff line number Diff line change 1+ name : submit-hackernews
2+ description : Submit links to Hacker News.
3+ inputs :
4+ username :
5+ description : The username of the Hacker News user.
6+ required : true
7+ password :
8+ description : The password of the Hacker News user.
9+ required : true
10+ title :
11+ description : The title of the link to submit.
12+ required : true
13+ url :
14+ description : The URL of the link to submit.
15+ required : true
16+ verbose :
17+ description : Whether to output verbose logs. Any non-empty value will be considered true.
18+ required : false
19+ default : " "
20+ runs :
21+ using : docker
22+ image : Dockerfile
23+ env :
24+ HACKERNEWS_USERNAME : ${{ inputs.username }}
25+ HACKERNEWS_PASSWORD : ${{ inputs.password }}
26+ HACKERNEWS_TITLE : ${{ inputs.title }}
27+ HACKERNEWS_URL : ${{ inputs.url }}
28+ VERBOSE : ${{ inputs.verbose }}
Original file line number Diff line number Diff line change @@ -19,6 +19,16 @@ usage() {
1919 echo " All four arguments MUST be provided."
2020}
2121
22+ set_verbosity () {
23+ set +u
24+
25+ if [ ! -z " $VERBOSE " ]; then
26+ set -x
27+ fi
28+
29+ set -u
30+ }
31+
2232prepare_cookie () {
2333 COOKIE_JAR=$( mktemp)
2434}
@@ -162,6 +172,8 @@ submit() {
162172}
163173
164174main () {
175+ set_verbosity
176+
165177 parse_args " $@ "
166178 parse_envs
167179 validate_args
You can’t perform that action at this time.
0 commit comments