-
Notifications
You must be signed in to change notification settings - Fork 1
/
action.yml
72 lines (69 loc) · 2.34 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
72
name: 'TerrakubeAction'
description: 'Github integration with Terrakube Platform'
branding:
icon: 'package'
color: 'purple'
inputs:
TERRAKUBE_TOKEN:
description: 'Terrakube Personal Access Token'
required: true
TERRAKUBE_ENDPOINT:
description: 'Terrakube Endpoint'
required: true
TERRAKUBE_TEMPLATE:
description: 'Terrakube Template'
required: true
TERRAKUBE_ORGANIZATION:
description: 'Terrakube Organization'
required: true
TERRAKUBE_BRANCH:
description: 'Repository branch to be executed'
required: true
TERRAKUBE_SSH_KEY_NAME:
description: 'Repository branch to be executed'
required: false
SHOW_OUTPUT:
description: 'Show Terrakube job output inside github commets'
required: true
GITHUB_TOKEN:
description: 'Github Token'
required: true
outputs:
JOB_ID:
description: 'Terrakube Job Execution Id'
runs:
using: "composite"
steps:
- name: Get changed folders
id: changed-files
uses: tj-actions/changed-files@v31
with:
dir_names: "true"
- name: List all folder changes
shell: bash
run: |
for folder in ${{ steps.changed-files.outputs.all_changed_files }}; do
echo "$folder was changed"
done
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 16
- run: |
node ${{ github.action_path }}/dist/main.js
id: terrakube-integration
shell: bash
env:
# INPUT_<VARIABLE_NAME> is not available in Composite run steps
# https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#example-specifying-inputs
INPUT_TERRAKUBE_TOKEN: ${{ inputs.TERRAKUBE_TOKEN }}
INPUT_TERRAKUBE_ENDPOINT: ${{ inputs.TERRAKUBE_ENDPOINT }}
INPUT_TERRAKUBE_TEMPLATE: ${{ inputs.TERRAKUBE_TEMPLATE }}
INPUT_TERRAKUBE_BRANCH: ${{ inputs.TERRAKUBE_BRANCH }}
INPUT_TERRAKUBE_ORGANIZATION: ${{ inputs.TERRAKUBE_ORGANIZATION }}
INPUT_TERRAKUBE_FOLDER: ${{ steps.changed-files.outputs.all_changed_files }}
INPUT_TERRAKUBE_SSH_KEY_NAME: ${{ inputs.TERRAKUBE_SSH_KEY_NAME }}
INPUT_SERVER_URL: ${{ github.server_url }}
INPUT_GIT_REPOSITORY: ${{ github.repository }}
INPUT_SHOW_OUTPUT: ${{ inputs.SHOW_OUTPUT }}
INPUT_GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }}