-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
46 lines (46 loc) · 1.89 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
name: "CloudThread Tag Assistant check"
description: "Checks if Terraform modules have default tag present in AWS provider configuration"
inputs:
terraform-path:
description: "Terraform configuration path"
required: false
default: '.'
cloudthread-token:
description: "The token to authenticate with CloudThread API endpoint"
required: true
catalog-key:
description: >
Catalog key that determies the teg set to be assigned by default to all the resources created by
Terraform configuration in this repository
required: true
tag-assistant-version:
default: 2.3
description: "Version to run"
api-root:
description: CloudThread API URL
required: false
default: "https://api.cloudthread.io/"
region:
description: Preferred AWS region (only us-west-2 is supported currently)
required: false
default: "us-west-2"
runs:
using: "composite"
steps:
- name: Get AWS credentials
id: get-ct-aws-creds
uses: cloudthread/ecr-login-action@v1
with:
cloudthread-token: ${{ inputs.cloudthread-token }}
api-root: ${{ inputs.api-root }}
region: ${{ inputs.region }}
- name: Run TA docker image
uses: addnab/docker-run-action@v3
with:
username: ${{ steps.get-ct-aws-creds.outputs.username }}
password: ${{ steps.get-ct-aws-creds.outputs.token }}
registry: ${{ steps.get-ct-aws-creds.outputs.registry }}
image: ${{ steps.get-ct-aws-creds.outputs.registry }}/tag-assistant:${{ inputs.tag-assistant-version }}
options: -v ${{ github.workspace }}:/opt/repo
run: |
./opt/ta/cloudthread-assistant --base-branch=${{ github.head_ref }} /opt/repo/${{ inputs.terraform-path }} --ghtoken=${{ github.token }} --repo=${{ github.repository }} --token=${{ inputs.cloudthread-token }} --key=${{ inputs.catalog-key }} --api-root=${{ inputs.api-root }}