From f10f3e4b66c5b3ac086630b546ee7c928f948906 Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Tue, 5 Dec 2023 01:13:59 +0300 Subject: [PATCH 01/10] Get any info from atmos describe component --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index ef98106..97b35c4 100644 --- a/action.yml +++ b/action.yml @@ -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 From 9d4cc6be4fa728a1abd8cb131d39942273154ec7 Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Tue, 5 Dec 2023 01:22:42 +0300 Subject: [PATCH 02/10] Update test-positive.yml --- .github/workflows/test-positive.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-positive.yml b/.github/workflows/test-positive.yml index 957dba9..2e4a89a 100644 --- a/.github/workflows/test-positive.yml +++ b/.github/workflows/test-positive.yml @@ -30,7 +30,7 @@ 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 From 12724a99026fc6d16e0086686f4aeb43986ba4d3 Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Tue, 5 Dec 2023 01:27:03 +0300 Subject: [PATCH 03/10] Update test-positive.yml --- .github/workflows/test-positive.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-positive.yml b/.github/workflows/test-positive.yml index 2e4a89a..9903626 100644 --- a/.github/workflows/test-positive.yml +++ b/.github/workflows/test-positive.yml @@ -37,14 +37,14 @@ jobs: 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 From e608d30d8f01cd6d8e6f83790d79b0a5c0c506fd Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Sat, 9 Dec 2023 00:51:17 +0100 Subject: [PATCH 04/10] Added README description --- README.md | 29 ++++++++++++++++++++++++++++- README.yaml | 30 +++++++++++++++++++++++++++++- 2 files changed, 57 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ca0204a..9a7c704 100644 --- a/README.md +++ b/README.md @@ -96,7 +96,7 @@ 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 @@ -104,6 +104,33 @@ components: secret-ids: ${{ steps.example.outputs.value }} ``` +## Migrate `v0` to `v1` + +Starting from `v1` the action do not restrict component config just to `settings` section. +If you want `v1` having the same behaviour as `v0` you should add `settings` in `settings-path` variable. + +```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 +``` + +same behaviour as + +```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 +``` + diff --git a/README.yaml b/README.yaml index f3493b8..c917d9c 100644 --- a/README.yaml +++ b/README.yaml @@ -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 }} ``` + + ## Migrate `v0` to `v1` + + Starting from `v1` the action do not restrict component config just to `settings` section. + If you want `v1` having the same behaviour as `v0` you should add `settings` in `settings-path` variable. + + ```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 + ``` + + same behaviour as + + ```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" From e77c8193800cfa91951c7ca98ffba041c5ef73e8 Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Sat, 9 Dec 2023 21:35:42 +0100 Subject: [PATCH 05/10] Update README --- README.md | 12 ++++++------ README.yaml | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 9a7c704..09863df 100644 --- a/README.md +++ b/README.md @@ -99,19 +99,19 @@ components: settings-path: settings.secrets-arn - name: Set ENV Vars with AWS Secrets Manager Secret - uses: aws-actions/aws-secretsmanager-get-secrets@v1 + uses: aws-actions/aws-secretsmanager-get-secrets@v2 with: secret-ids: ${{ steps.example.outputs.value }} ``` -## Migrate `v0` to `v1` +## Migrate `v1` to `v2` -Starting from `v1` the action do not restrict component config just to `settings` section. -If you want `v1` having the same behaviour as `v0` you should add `settings` in `settings-path` variable. +Starting from `v2` the action do not restrict component config just to `settings` section. +If you want `v2` having the same behaviour as `v1` you should add `settings` in `settings-path` variable. ```yaml - name: Get Atmos Setting for Secret ARN - uses: cloudposse/github-action-atmos-get-setting@v1 + uses: cloudposse/github-action-atmos-get-setting@v2 id: example with: component: foo @@ -123,7 +123,7 @@ same behaviour as ```yaml - name: Get Atmos Setting for Secret ARN - uses: cloudposse/github-action-atmos-get-setting@v0 + uses: cloudposse/github-action-atmos-get-setting@v1 id: example with: component: foo diff --git a/README.yaml b/README.yaml index c917d9c..e1cb8e0 100644 --- a/README.yaml +++ b/README.yaml @@ -75,19 +75,19 @@ usage: |- settings-path: settings.secrets-arn - name: Set ENV Vars with AWS Secrets Manager Secret - uses: aws-actions/aws-secretsmanager-get-secrets@v1 + uses: aws-actions/aws-secretsmanager-get-secrets@v2 with: secret-ids: ${{ steps.example.outputs.value }} ``` - ## Migrate `v0` to `v1` + ## Migrate `v1` to `v2` - Starting from `v1` the action do not restrict component config just to `settings` section. - If you want `v1` having the same behaviour as `v0` you should add `settings` in `settings-path` variable. + Starting from `v2` the action do not restrict component config just to `settings` section. + If you want `v2` having the same behaviour as `v1` you should add `settings` in `settings-path` variable. ```yaml - name: Get Atmos Setting for Secret ARN - uses: cloudposse/github-action-atmos-get-setting@v1 + uses: cloudposse/github-action-atmos-get-setting@v2 id: example with: component: foo @@ -99,7 +99,7 @@ usage: |- ```yaml - name: Get Atmos Setting for Secret ARN - uses: cloudposse/github-action-atmos-get-setting@v0 + uses: cloudposse/github-action-atmos-get-setting@v1 id: example with: component: foo From 52b67ea8909e64c51db4020291f235a0156c0283 Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Sat, 9 Dec 2023 22:55:07 +0100 Subject: [PATCH 06/10] Update README --- README.md | 4 ++-- README.yaml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 09863df..cf93e33 100644 --- a/README.md +++ b/README.md @@ -106,8 +106,8 @@ components: ## Migrate `v1` to `v2` -Starting from `v2` the action do not restrict component config just to `settings` section. -If you want `v2` having the same behaviour as `v1` you should add `settings` in `settings-path` variable. +Starting from `v2` the action is no longer restricted to retrieving the component config from only the `settings` section.. +If you want the same behavior in `v2` as in`v1`, you should add the `settings` prefix to the value of the `settings-path` variable. ```yaml - name: Get Atmos Setting for Secret ARN diff --git a/README.yaml b/README.yaml index e1cb8e0..ef26dd3 100644 --- a/README.yaml +++ b/README.yaml @@ -80,10 +80,10 @@ usage: |- secret-ids: ${{ steps.example.outputs.value }} ``` - ## Migrate `v1` to `v2` + ## Migrating from `v1` to `v2` - Starting from `v2` the action do not restrict component config just to `settings` section. - If you want `v2` having the same behaviour as `v1` you should add `settings` in `settings-path` variable. + Starting from `v2` the action is no longer restricted to retrieving the component config from only the `settings` section.. + If you want the same behavior in `v2` as in`v1`, you should add the `settings` prefix to the value of the `settings-path` variable. ```yaml - name: Get Atmos Setting for Secret ARN From 7b51c5db24203b9ddd1ca52d2d64a7b4d0b90551 Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Tue, 12 Dec 2023 01:42:14 +0100 Subject: [PATCH 07/10] Update README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cf93e33..a1f4ccd 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,7 @@ components: secret-ids: ${{ steps.example.outputs.value }} ``` -## Migrate `v1` to `v2` +## Migrating from `v1` to `v2` Starting from `v2` the action is no longer restricted to retrieving the component config from only the `settings` section.. If you want the same behavior in `v2` as in`v1`, you should add the `settings` prefix to the value of the `settings-path` variable. From 25b15752288edd13bed53a7f07cd14699d03a370 Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Tue, 12 Dec 2023 03:43:01 +0300 Subject: [PATCH 08/10] Apply suggestions from code review Co-authored-by: Jeremy White Co-authored-by: Erik Osterman (CEO @ Cloud Posse) --- README.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.yaml b/README.yaml index ef26dd3..cc03adb 100644 --- a/README.yaml +++ b/README.yaml @@ -82,9 +82,9 @@ usage: |- ## Migrating from `v1` to `v2` - Starting from `v2` the action is no longer restricted to retrieving the component config from only the `settings` section.. - If you want the same behavior in `v2` as in`v1`, you should add the `settings` prefix to the value of the `settings-path` variable. - + Starting from `v2` the action is no longer restricted to retrieving the component config from only the `settings` section. + If you want the same behavior in `v2` as in`v1`, you should add the `settings.` prefix to the value of the `settings-path` variable. + For example, in `v2` 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@v2 @@ -95,7 +95,7 @@ usage: |- settings-path: settings.secrets-arn ``` - same behaviour as + Which would provide the same output as passing only `secrets-arn` in `v1` ```yaml - name: Get Atmos Setting for Secret ARN From 7470aa59df4d792a66dcb0e5afd9ac21a4b449e0 Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Tue, 12 Dec 2023 01:43:39 +0100 Subject: [PATCH 09/10] Update README --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a1f4ccd..f15724e 100644 --- a/README.md +++ b/README.md @@ -106,9 +106,9 @@ components: ## Migrating from `v1` to `v2` -Starting from `v2` the action is no longer restricted to retrieving the component config from only the `settings` section.. -If you want the same behavior in `v2` as in`v1`, you should add the `settings` prefix to the value of the `settings-path` variable. - +Starting from `v2` the action is no longer restricted to retrieving the component config from only the `settings` section. +If you want the same behavior in `v2` as in`v1`, you should add the `settings.` prefix to the value of the `settings-path` variable. +For example, in `v2` 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@v2 @@ -119,7 +119,7 @@ If you want the same behavior in `v2` as in`v1`, you should add the `settings` settings-path: settings.secrets-arn ``` -same behaviour as +Which would provide the same output as passing only `secrets-arn` in `v1` ```yaml - name: Get Atmos Setting for Secret ARN From 2552d45b0b314ef29eed7ffc30dfc25877c051c6 Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Tue, 12 Dec 2023 01:48:17 +0100 Subject: [PATCH 10/10] Update README --- README.md | 16 ++++++++-------- README.yaml | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index f15724e..4f78c38 100644 --- a/README.md +++ b/README.md @@ -99,19 +99,19 @@ components: settings-path: settings.secrets-arn - name: Set ENV Vars with AWS Secrets Manager Secret - uses: aws-actions/aws-secretsmanager-get-secrets@v2 + uses: aws-actions/aws-secretsmanager-get-secrets@v1 with: secret-ids: ${{ steps.example.outputs.value }} ``` -## Migrating from `v1` to `v2` +## Migrating from `v0` to `v1` -Starting from `v2` the action is no longer restricted to retrieving the component config from only the `settings` section. -If you want the same behavior in `v2` as in`v1`, you should add the `settings.` prefix to the value of the `settings-path` variable. -For example, in `v2` you would provide `settings.secrets-arn` as the value to the `settings-path` +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@v2 + uses: cloudposse/github-action-atmos-get-setting@v1 id: example with: component: foo @@ -119,11 +119,11 @@ For example, in `v2` you would provide `settings.secrets-arn` as the value to th settings-path: settings.secrets-arn ``` -Which would provide the same output as passing only `secrets-arn` in `v1` +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@v1 + uses: cloudposse/github-action-atmos-get-setting@v0 id: example with: component: foo diff --git a/README.yaml b/README.yaml index cc03adb..6f89df5 100644 --- a/README.yaml +++ b/README.yaml @@ -75,19 +75,19 @@ usage: |- settings-path: settings.secrets-arn - name: Set ENV Vars with AWS Secrets Manager Secret - uses: aws-actions/aws-secretsmanager-get-secrets@v2 + uses: aws-actions/aws-secretsmanager-get-secrets@v1 with: secret-ids: ${{ steps.example.outputs.value }} ``` - ## Migrating from `v1` to `v2` + ## Migrating from `v0` to `v1` - Starting from `v2` the action is no longer restricted to retrieving the component config from only the `settings` section. - If you want the same behavior in `v2` as in`v1`, you should add the `settings.` prefix to the value of the `settings-path` variable. - For example, in `v2` you would provide `settings.secrets-arn` as the value to the `settings-path` + 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@v2 + uses: cloudposse/github-action-atmos-get-setting@v1 id: example with: component: foo @@ -95,11 +95,11 @@ usage: |- settings-path: settings.secrets-arn ``` - Which would provide the same output as passing only `secrets-arn` in `v1` + 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@v1 + uses: cloudposse/github-action-atmos-get-setting@v0 id: example with: component: foo