-
Notifications
You must be signed in to change notification settings - Fork 0
/
op.yml
69 lines (69 loc) · 1.77 KB
/
op.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: github.com/opspec-pkgs/opspec.op.get-latest-version
description: gets the latest version of an [opspec](https://opspec.io) op
inputs:
ref:
string:
constraints:
minLength: 1
description: reference to the op; formatted as `host/path/repo#tag`
pullCreds:
object:
description: creds object used to auth w/ the source of the operation
constraints:
properties:
username:
minLength: 1
password:
minLength: 1
default:
username: ' '
password: ' '
outputs:
latestVersion:
string:
constraints:
format: semver
description: latest version of the op
version: 2.0.0
run:
serial:
- op:
ref: github.com/opspec-pkgs/url.parse#1.0.0
inputs:
url: https://$(ref)
outputs:
url: $(parsedRef)
- op:
ref: github.com/opspec-pkgs/git.repo.clone-https#1.0.0
inputs:
username: $(pullCreds.username)
password: $(pullCreds.password)
url: $(parsedRef.origin)$(parsedRef.pathname)
outputs:
repo:
- op:
ref: github.com/opspec-pkgs/git.repo.tags.list#1.0.0
inputs:
dotGitDir: $(repo/.git)
outputs:
tags:
- op:
ref: github.com/opspec-pkgs/jmespath.query.evaluate#1.0.0
inputs:
data: $(tags)
query: '[*].name'
outputs:
result: $(tags)
- op:
ref: github.com/opspec-pkgs/semver.v2.sort#1.0.0
inputs:
semVers: $(tags)
outputs:
semVers:
- op:
ref: github.com/opspec-pkgs/jmespath.query.evaluate#1.0.0
inputs:
data: $(semVers)
query: '[-1]'
outputs:
result: $(latestVersion)