-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaction.yml
69 lines (64 loc) · 1.96 KB
/
action.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
# Copyright IBM Corp. 2023
# Made available under the MIT License
name: "Login to StepZen Server"
author: "IBM"
description: |
Log into StepZen Server
inputs:
domain:
description: "StepZen domain (defaults to stepzen.net)"
required: true
default: "stepzen.net"
account:
description: "StepZen account name"
required: true
adminkey:
description: "Admin key of the StepZen account"
required: true
max_attempts:
description: "Number of retry attempts."
required: false
default: "3"
retry_wait_seconds:
description: "Time to wait between retries in seconds."
required: false
default: "10"
timeout_seconds:
description: "Seconds to wait before attempt times out"
required: false
default: "60"
outputs:
domain:
description: "Domain the account is logged into."
value: ${{ steps.output.outputs.domain }}
account:
description: "Account that is logged in."
value: ${{ steps.output.outputs.account }}
apikey:
description: "API key for the account."
value: ${{ steps.output.outputs.apikey }}
runs:
using: "composite"
steps:
# Don't assume the admin key came from a secret so mask it for safety
- name: mask
shell: bash
run: |
adminkey=${{ inputs.adminkey }}
echo "::add-mask::${adminkey}"
- name: "login"
uses: nick-fields/retry@v3
with:
timeout_seconds: ${{ inputs.timeout_seconds }}
max_attempts: ${{ inputs.max_attempts }}
retry_wait_seconds: ${{ inputs.retry_wait_seconds }}
shell: bash
command: stepzen login ${{ inputs.domain }} --account ${{ inputs.account }} --adminkey ${{ inputs.adminkey }}
- id: output
run: |
apikey=$(stepzen whoami --apikey)
echo "::add-mask::${apikey}"
echo "domain=$(stepzen whoami --domain)" >> $GITHUB_OUTPUT
echo "account=${{ inputs.account }}" >> $GITHUB_OUTPUT
echo "apikey=${apikey}" >> $GITHUB_OUTPUT
shell: bash