-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathaction.yml
More file actions
86 lines (82 loc) · 2.83 KB
/
Copy pathaction.yml
File metadata and controls
86 lines (82 loc) · 2.83 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
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"
default: "main"
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
IGNORE_SSL_ERROR:
description: "Ignore SSL errors (e.g. self-signed certificate)"
required: false
default: false
outputs:
JOB_ID:
description: "Terrakube Job Execution Id"
runs:
using: "composite"
steps:
- name: Get changed folders
id: changed-files
uses: tj-actions/changed-files@22103cc46bda19c2b464ffe86db46df6922fd323 # v47.0.5
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@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: 16
- name: Install dependencies
shell: bash
run: |
yarn install
yarn build
working-directory: ${{ github.action_path }}
- 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 }}
INPUT_IGNORE_SSL_ERROR: ${{ inputs.IGNORE_SSL_ERROR }}
INPUT_GITHUB_WORKSPACE: ${{ github.workspace }}