-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
71 lines (65 loc) · 1.99 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
70
71
name: Inigo GraphQL
description: 'Inigo GraphQL github-action to run configuration/schema checks'
inputs:
username:
required: true
description: 'Inigo account username.'
password:
required: true
description: 'Inigo account password.'
path:
required: true
description: 'Path to inigo configuration file(s).'
label:
required: false
description: 'Inigo service label.'
action:
required: false
description: 'Action to perform: "check" for CI, "apply" for CD.'
type: choice
options:
- check
- apply
default: check
cli:
required: false
description: 'Path to inigo_cli. By default, latest inigo_cli will be used.'
cli_url:
required: false
description: 'URL to download Inigo CLI.'
default: 'https://github.com/inigolabs/artifacts/releases/latest/download/cli_linux_amd64.tar.gz'
github-token:
required: false
description: 'Github Token. Use {{ github.token }} by default.'
default: ${{ github.token }}
runs:
using: composite
steps:
- name: Setup Node 20
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install Inigo CLI and Login
if: ${{ inputs.cli == '' }}
run: wget -c ${{ inputs.cli_url }} -O - | tar -xz && ./inigo login;
env:
INIGO_USERNAME: ${{ inputs.username }}
INIGO_PASSWORD: ${{ inputs.password }}
shell: bash
- name: Inigo CLI Login
if: ${{ inputs.cli != '' }}
env:
INIGO_USERNAME: ${{ inputs.username }}
INIGO_PASSWORD: ${{ inputs.password }}
run: ${{ inputs.cli }} login
shell: bash
- name: Run Inigo CLI Checks
run: node ${{ github.action_path }}/dist/index.js
env:
INIGO_CLI: ${{ inputs.cli || './inigo' }}
INIGO_CONFIG_PATH: ${{ inputs.path }}
INIGO_SERVICE_LABEL: ${{ inputs.label }}
INIGO_ACTION: ${{ inputs.action }}
GITHUB_TOKEN: ${{ inputs.github-token }}
GITHUB_WORKSPACE: ${{ github.workspace }}
shell: bash