-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
38 lines (37 loc) · 1.04 KB
/
action.yml
File metadata and controls
38 lines (37 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: “Fortune” for Git Things Done
description: Adds a fortune to your “Git Things Done” entry
inputs:
today:
description: >
The current GitTD issue number.
If unset we use `$GTD_TODAY`.
required: false
token:
description: Typically (eg. {{ secrets.GITHUB_TOKEN }}).
default: ${{ github.token }}
outputs:
fortune:
description: The fortune added to the journal entry
value: ${{ steps.fortune.outputs.value }}
runs:
using: composite
steps:
- run: |
set -euo pipefail
FORTUNE=$(curl http://yerkee.com/api/fortune -s | jq -r .fortune)
gh issue comment "$TODAY" --body-file - <<EOD
# Fortune
$FORTUNE
EOD
FORTUNE="${FORTUNE//'%'/'%25'}"
FORTUNE="${FORTUNE//$'\n'/'%0A'}"
FORTUNE="${FORTUNE//$'\r'/'%0D'}"
echo "::set-output name=value::$FORTUNE"
shell: bash
id: fortune
env:
TODAY: ${{ inputs.today || env.GTD_TODAY }}
GITHUB_TOKEN: ${{ inputs.token }}
branding:
icon: check-square
color: green