-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgithub.yml
42 lines (42 loc) · 1.49 KB
/
github.yml
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
39
40
41
42
# github.yml
variables:
BASE_URL: https://api.github.com/repos/finestructure/Rester
requests:
releases:
url: ${BASE_URL}/releases
headers:
# If you're getting rate limited by the Github API, run this
# restfile with a Github token.
# Uncomment the line starting with "Authorization:" below and
# - if you are running the binary set a GITHUB_TOKEN environment
# variable with your token
# - if running via docker, pass in the token as follows:
# `docker run -e GITHUB_TOKEN=<token> ...`
# Authorization: token ${GITHUB_TOKEN}
validation:
status: 200
json:
# validate the first id in the list (latest release)
# this also captures it as a variable
0:
id: .regex(\d+)
log:
# log the id to the console
- json[0].id
latest_release:
# use the release id to request release details
url: ${BASE_URL}/releases/${releases[0].id}
headers:
# If you're getting rate limited by the Github API, run this
# restfile with a Github token.
# Uncomment the line starting with "Authorization:" below and
# - if you are running the binary set a GITHUB_TOKEN environment
# variable with your token
# - if running via docker, pass in the token as follows:
# `docker run -e GITHUB_TOKEN=<token> ...`
# Authorization: token ${GITHUB_TOKEN}
validation:
status: 200
log:
# log the latest release tag to the console
- json.tag_name