-
Notifications
You must be signed in to change notification settings - Fork 58
/
action.yaml
76 lines (64 loc) · 2.04 KB
/
action.yaml
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
# Copyright 2022 Chainguard, Inc.
# SPDX-License-Identifier: Apache-2.0
name: 'Setup Chainguard terraform provider'
description: |
This action sets up the Chainguard terraform provider for a particular environment.
inputs:
environment:
description: |
Determines the environment from which to download the chainctl
binary from.
required: true
default: enforce.dev
identity:
description: |
The id of the identity that this workflow should assume for
performing actions with chainctl.
required: false
audience:
description: |
Specifies the identity token audience to use when creating an
identity token to authenticate with Chainguard.
Defaults to issuer.${environment}
This field is DEPRECATED, use identity instead.
required: false
invite-code:
description: |
Optionally specifies an invite code that allows this workflow
register itself when run for the first time.
Use of invite codes is DEPRECATED, use identity instead.
required: false
runs:
using: "composite"
steps:
- id: default-audience
shell: bash
run: |
AUDIENCE="${{ inputs.audience }}"
if [[ -z "${AUDIENCE}" ]]; then
AUDIENCE=issuer.${{ inputs.environment }}
fi
echo "audience=${AUDIENCE}" >> $GITHUB_OUTPUT
- uses: chainguard-dev/actions/setup-chainctl@main
with:
environment: ${{ inputs.environment }}
audience: ${{ steps.default-audience.outputs.audience }}
invite-code: ${{ inputs.invite-code }}
identity: ${{ inputs.identity }}
- shell: bash
run: |
cat > ~/.terraformrc <<EOF
provider_installation {
network_mirror {
url = "https://dl.${{ inputs.environment }}/terraform-provider/"
include = [
"registry.terraform.io/chainguard/chainguard",
]
}
direct {
exclude = [
"registry.terraform.io/chainguard/chainguard",
]
}
}
EOF