Skip to content

Commit 58b87cc

Browse files
author
Antoine THEBAUD
committed
Move login to a dedicated action
Signed-off-by: Antoine THEBAUD <[email protected]>
1 parent ff5c136 commit 58b87cc

File tree

6 files changed

+23
-149
lines changed

6 files changed

+23
-149
lines changed

.github/workflows/dac.yaml

Lines changed: 10 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -114,24 +114,25 @@ jobs:
114114
with:
115115
directory: ./built
116116

117-
# TODO append preview links to PR
118-
- name: Preview the dashboards
119-
if: ${{ !inputs.skip_preview }}
120-
uses: ./actions/preview_dashboards
117+
- name: Login to the API server
118+
uses: ./actions/login
121119
with:
122-
# general:
123120
url: ${{ inputs.url }}
124-
directory: ./built
125-
project: ${{ inputs.project }}
126-
# auth:
127121
username: ${{ inputs.username }}
128122
password: ${{ inputs.password }}
129123
token: ${{ inputs.token }}
130124
provider: ${{ inputs.provider }}
131125
client-id: ${{ inputs.client-id }}
132126
client-secret: ${{ inputs.client-secret }}
133127
insecure-skip-tls-verify: ${{ inputs.insecure-skip-tls-verify }}
134-
# preview-specific
128+
129+
# TODO append preview links to PR
130+
- name: Preview the dashboards
131+
if: ${{ !inputs.skip_preview }}
132+
uses: ./actions/preview_dashboards
133+
with:
134+
directory: ./built
135+
project: ${{ inputs.project }}
135136
output: ${{ inputs.output }}
136137
prefix: ${{ inputs.prefix }}
137138
ttl: ${{ inputs.ttl }}
@@ -141,35 +142,14 @@ jobs:
141142
if: ${{ !inputs.skip_diff }}
142143
uses: ./actions/diff_dashboards
143144
with:
144-
# general inputs:
145-
url: ${{ inputs.url }}
146145
directory: ./built
147146
project: ${{ inputs.project }}
148-
# auth inputs:
149-
username: ${{ inputs.username }}
150-
password: ${{ inputs.password }}
151-
token: ${{ inputs.token }}
152-
provider: ${{ inputs.provider }}
153-
client-id: ${{ inputs.client-id }}
154-
client-secret: ${{ inputs.client-secret }}
155-
insecure-skip-tls-verify: ${{ inputs.insecure-skip-tls-verify }}
156147

157148
# TODO skip deploy if pull request
158149
- name: Deploy the dashboards
159150
if: ${{ !inputs.skip_deploy }}
160151
uses: ./actions/apply_resources
161152
with:
162-
# general:
163-
url: ${{ inputs.url }}
164153
directory: ./built
165154
project: ${{ inputs.project }}
166-
# auth:
167-
username: ${{ inputs.username }}
168-
password: ${{ inputs.password }}
169-
token: ${{ inputs.token }}
170-
provider: ${{ inputs.provider }}
171-
client-id: ${{ inputs.client-id }}
172-
client-secret: ${{ inputs.client-secret }}
173-
insecure-skip-tls-verify: ${{ inputs.insecure-skip-tls-verify }}
174-
# deploy-specific:
175155
force: ${{ inputs.force }}

actions/apply_resources/action.yaml

Lines changed: 3 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,14 @@
11
name: Apply the resources
2-
description: Run the `apply` command of percli to deploy Perses resources to the API server
2+
description: |
3+
Run the `apply` command of percli to deploy Perses resources to the API server
4+
**Note:** Login to an API server is required before running this action. You can use the provided `login` action for this purpose.
35
inputs:
4-
url:
5-
description: The URL of the Perses API server where to deploy the dashboard preview.
6-
required: true
76
directory:
87
description: Path to the directory containing the resources consumed by the command (mutually exclusive with `file`).
98
required: false
109
file:
1110
description: Path to the file that contains the resources consumed by the command (mutually exclusive with `directory`).
1211
required: false
13-
username:
14-
description: Username for basic authentication to the API server.
15-
required: false
16-
password:
17-
description: Password for basic authentication to the API server.
18-
required: false
19-
token:
20-
description: Bearer token for authentication to the API server.
21-
required: false
22-
provider:
23-
description: External authentication provider identifier. (slug_id)
24-
required: false
25-
client-id:
26-
description: Client ID used for robotic access when using external authentication provider.
27-
required: false
28-
client-secret:
29-
description: Client Secret used for robotic access when using external authentication provider.
30-
required: false
31-
insecure-skip-tls-verify:
32-
description: If true the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
33-
required: false
3412
project:
3513
description: If present, the project scope for this CLI request.
3614
required: false
@@ -40,18 +18,6 @@ inputs:
4018
runs:
4119
using: composite
4220
steps:
43-
- name: Login to the Perses API
44-
uses: ./actions/login
45-
with:
46-
url: ${{ inputs.url }}
47-
username: ${{ inputs.username }}
48-
password: ${{ inputs.password }}
49-
token: ${{ inputs.token }}
50-
provider: ${{ inputs.provider }}
51-
client-id: ${{ inputs.client-id }}
52-
client-secret: ${{ inputs.client-secret }}
53-
insecure-skip-tls-verify: ${{ inputs.insecure-skip-tls-verify }}
54-
5521
- name: Run the `apply` command
5622
run: |
5723
percli apply \

actions/diff_dashboards/action.yaml

Lines changed: 3 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,20 @@
11
name: Build the dashboards as code
2-
description: Run the `dac diff` command of percli to generate diffs between the local dashboards and their remote counterparts on the API server
2+
description: |
3+
Run the `dac diff` command of percli to generate diffs between the local dashboards and their remote counterparts on the API server.
4+
**Note:** Login to an API server is required before running this action. You can use the provided `login` action for this purpose.
35
inputs:
4-
url:
5-
description: The URL of the Perses API server where to deploy the dashboard preview.
6-
required: true
76
directory:
87
description: Path to the directory containing the resources consumed by the command (mutually exclusive with `file`).
98
required: false
109
file:
1110
description: Path to the file that contains the resources consumed by the command (mutually exclusive with `directory`).
1211
required: false
13-
username:
14-
description: Username for basic authentication to the API server.
15-
required: false
16-
password:
17-
description: Password for basic authentication to the API server.
18-
required: false
19-
token:
20-
description: Bearer token for authentication to the API server.
21-
required: false
22-
provider:
23-
description: External authentication provider identifier. (slug_id)
24-
required: false
25-
client-id:
26-
description: Client ID used for robotic access when using external authentication provider.
27-
required: false
28-
client-secret:
29-
description: Client Secret used for robotic access when using external authentication provider.
30-
required: false
31-
insecure-skip-tls-verify:
32-
description: If true the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
33-
required: false
3412
project:
3513
description: If present, the project scope for this CLI request.
3614
required: false
3715
runs:
3816
using: composite
3917
steps:
40-
- name: Login to the Perses API
41-
uses: ./actions/login
42-
with:
43-
url: ${{ inputs.url }}
44-
username: ${{ inputs.username }}
45-
password: ${{ inputs.password }}
46-
token: ${{ inputs.token }}
47-
provider: ${{ inputs.provider }}
48-
client-id: ${{ inputs.client-id }}
49-
client-secret: ${{ inputs.client-secret }}
50-
insecure-skip-tls-verify: ${{ inputs.insecure-skip-tls-verify }}
51-
5218
- name: Run the `dac diff` command
5319
run: |
5420
percli dac diff \

actions/login/action.yaml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,8 @@ name: Login to Perses
22
description: Run the `login` command of percli to authenticate to the API server
33
inputs:
44
url:
5-
description: The URL of the Perses API server where to deploy the dashboard preview.
5+
description: The URL of the Perses API server.
66
required: true
7-
directory:
8-
description: Path to the directory containing the resources consumed by the command (mutually exclusive with `file`).
9-
required: false
10-
file:
11-
description: Path to the file that contains the resources consumed by the command (mutually exclusive with `directory`).
12-
required: false
137
username:
148
description: Username for basic authentication to the API server.
159
required: false

actions/preview_dashboards/action.yaml

Lines changed: 3 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,14 @@
11
name: Preview dashboards
2-
description: Run the `dac preview` command of percli to deploy ephemeral dashboards to the API server
2+
description: |
3+
Run the `dac preview` command of percli to deploy ephemeral dashboards to the API server
4+
**Note:** Login to an API server is required before running this action. You can use the provided `login` action for this purpose.
35
inputs:
4-
url:
5-
description: The URL of the Perses API server where to deploy the dashboard preview.
6-
required: true
76
directory:
87
description: Path to the directory containing the resources consumed by the command (mutually exclusive with `file`).
98
required: false
109
file:
1110
description: Path to the file that contains the resources consumed by the command (mutually exclusive with `directory`).
1211
required: false
13-
username:
14-
description: Username for basic authentication to the API server.
15-
required: false
16-
password:
17-
description: Password for basic authentication to the API server.
18-
required: false
19-
token:
20-
description: Bearer token for authentication to the API server.
21-
required: false
22-
provider:
23-
description: External authentication provider identifier. (slug_id)
24-
required: false
25-
client-id:
26-
description: Client ID used for robotic access when using external authentication provider.
27-
required: false
28-
client-secret:
29-
description: Client Secret used for robotic access when using external authentication provider.
30-
required: false
31-
insecure-skip-tls-verify:
32-
description: If true the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
33-
required: false
3412
output:
3513
description: "Format of the output: json or yaml (default is yaml)."
3614
required: false
@@ -46,18 +24,6 @@ inputs:
4624
runs:
4725
using: composite
4826
steps:
49-
- name: Login to the Perses API
50-
uses: ./actions/login
51-
with:
52-
url: ${{ inputs.url }}
53-
username: ${{ inputs.username }}
54-
password: ${{ inputs.password }}
55-
token: ${{ inputs.token }}
56-
provider: ${{ inputs.provider }}
57-
client-id: ${{ inputs.client-id }}
58-
client-secret: ${{ inputs.client-secret }}
59-
insecure-skip-tls-verify: ${{ inputs.insecure-skip-tls-verify }}
60-
6127
- name: Run the `dac preview` command
6228
run: |
6329
percli dac preview \

actions/validate_resources/action.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
name: Validate resources
2-
description: Run the `lint` command of percli to validate Perses resources
2+
description: |
3+
Run the `lint` command of percli to validate Perses resources
4+
**Note:** In online mode, login to an API server is required before running this action. You can use the provided `login` action for this purpose.
35
inputs:
46
directory:
57
description: Path to the directory containing the resources consumed by the command (mutually exclusive with `file`).

0 commit comments

Comments
 (0)