Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get any info from atmos describe component #17

Merged
merged 10 commits into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/test-positive.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,21 @@ jobs:
with:
component: foo
stack: core-ue1-dev
settings-path: level1.level2.level3.secrets-arn
settings-path: settings.level1.level2.level3.secrets-arn

- uses: ./
id: derived
with:
component: derived
stack: core-ue1-dev
settings-path: level1.example
settings-path: settings.level1.example

- uses: ./
id: defaults
with:
component: test-defaults
stack: core-ue1-dev
settings-path: level1.example
settings-path: settings.level1.example

assert:
runs-on: ubuntu-latest
Expand Down
29 changes: 28 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,41 @@ components:
with:
component: foo
stack: core-ue1-dev
settings-path: secrets-arn
settings-path: settings.secrets-arn

- name: Set ENV Vars with AWS Secrets Manager Secret
uses: aws-actions/aws-secretsmanager-get-secrets@v1
with:
secret-ids: ${{ steps.example.outputs.value }}
```

## 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
```




Expand Down
30 changes: 29 additions & 1 deletion README.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,41 @@ usage: |-
with:
component: foo
stack: core-ue1-dev
settings-path: secrets-arn
settings-path: settings.secrets-arn

- name: Set ENV Vars with AWS Secrets Manager Secret
uses: aws-actions/aws-secretsmanager-get-secrets@v1
with:
secret-ids: ${{ steps.example.outputs.value }}
```

## 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"
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ runs:
-s ${{ inputs.stack }} \
--format json \
--file "$OUTPUT_FILE" || echo '{}' > "$OUTPUT_FILE"
value=$(jq -rc --arg key ${{ inputs.settings-path }} '.settings | getpath($key | split("."))' "$OUTPUT_FILE")
value=$(jq -rc --arg key ${{ inputs.settings-path }} '. | getpath($key | split("."))' "$OUTPUT_FILE")
echo "value=$value" >> $GITHUB_OUTPUT