generated from cloudposse-github-actions/composite-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.yaml
136 lines (114 loc) · 4.28 KB
/
README.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
---
#
# This is the canonical configuration for the `README.md`
# Run `make readme` to rebuild the `README.md`
#
# Name of this project
name: github-action-atmos-get-setting
# Tags of this project
tags:
- github-action
# Logo for this project
#logo: docs/logo.png
# License of this project
license: "APACHE2"
# Canonical GitHub repo
github_repo: cloudposse/github-action-atmos-get-setting
# Badges to display
badges:
- name: "Latest Release"
image: "https://img.shields.io/github/release/cloudposse/github-action-atmos-get-setting.svg"
url: "https://github.com/cloudposse/github-action-atmos-get-setting/releases/latest"
- name: "Slack Community"
image: "https://slack.cloudposse.com/badge.svg"
url: "https://slack.cloudposse.com"
related: []
# Short description of this project
description: GitHub Action to retrieve a setting from [atmos](https://github.com/cloudposse/atmos) configuration.
introduction: |-
GitHub Action to retrieve settings from [atmos](https://github.com/cloudposse/atmos) configuration. There are two ways
to use this action. The first is to retrieve a single setting and to get its value returned via the `value` output.
The second is to retrieve multiple settings as an object returned via the `settings` output.
references:
- name: "github-actions-workflows"
description: "Reusable workflows for different types of projects"
url: "https://github.com/cloudposse/github-actions-workflows"
# How to use this project
usage: |-
```
# Example stacks/dev.yaml
components:
terraform:
foo:
settings:
roleArn: arn:aws:iam::000000000000:role/MyRole
secretsArn: arn:aws:secretsmanager:us-east-1:000000000000:secret:MySecret-PlMes3
vars:
foo: bar
```
```yaml
name: Pull Request
on:
pull_request:
branches: [ 'main' ]
types: [opened, synchronize, reopened, closed, labeled, unlabeled]
jobs:
context:
runs-on: ubuntu-latest
steps:
# The following example will return a single setting value of
# `arn:aws:secretsmanager:us-east-1:000000000000:secret:MySecret-PlMes3` in the `value` output:
- name: Get Atmos Single Setting for Secret ARN
uses: cloudposse/github-action-atmos-get-setting@main
id: example
with:
component: foo
stack: core-ue1-dev
settings-path: settings.secrets-arn
# The following example will return an object with the following structure in the `settings` output:
# {"secretsArn":"arn:aws:secretsmanager:us-east-1:000000000000:secret:MySecret-PlMes3", "roleArn":"arn:aws:iam::000000000000:role/MyRole"}
- name: Get Atmos Multiple Settings
uses: cloudposse/github-action-atmos-get-setting@main
id: example
with:
settings: |
- component: foo
stack: core-ue1-dev
settingsPath: settings.secrets-arn
outputPath: secretsArn
- component: foo
stack: core-ue1-dev
settingsPath: settings.secrets-arn
outputPath: roleArn
```
## Migrating from `v0` to `v1`
Starting from `v1` the action is no longer restricted to retrieving the component config from only the `settings` section.
If you want the same behavior in `v1` as in`v0`, you should add the `settings.` prefix to the value of the `settings-path` variable.
For example, in `v1` you would provide `settings.secrets-arn` as the value to the `settings-path`
```yaml
- name: Get Atmos Setting for Secret ARN
uses: cloudposse/github-action-atmos-get-setting@v1
id: example
with:
component: foo
stack: core-ue1-dev
settings-path: settings.secrets-arn
```
Which would provide the same output as passing only `secrets-arn` in `v0`
```yaml
- name: Get Atmos Setting for Secret ARN
uses: cloudposse/github-action-atmos-get-setting@v0
id: example
with:
component: foo
stack: core-ue1-dev
settings-path: secrets-arn
```
include:
- "docs/github-action.md"
# Contributors to this project
contributors:
- name: "Matt Calhoun"
github: "mcalhoun"
- name: "Daniel Miller"
github: "milldr"