diff --git a/.github/workflows/67-fromjson-env-var.yaml b/.github/workflows/67-fromjson-env-var.yaml new file mode 100644 index 0000000000..5220077a44 --- /dev/null +++ b/.github/workflows/67-fromjson-env-var.yaml @@ -0,0 +1,17 @@ +name: 67 - FromJSON env var + +on: + workflow_dispatch: + +env: + myjson: '{"foo1" : "bar1", "foo2": "bar2"}' + var_foo: 'foo2' + +jobs: + job1: + runs-on: ubuntu-latest + steps: + - run: echo ${{ fromJSON(env.myjson).foo2 }} + - run: echo ${{ fromJSON(env.myjson)[env.var_foo] }} + +# REF: https://stackoverflow.com/questions/77123861/github-actions-workflow-how-to-access-fromjson-dictionary-value-using-the-key-s diff --git a/README.md b/README.md index 7dcf62ea80..a40f98ae6f 100644 --- a/README.md +++ b/README.md @@ -298,3 +298,11 @@ This workflow illustrates how to identify updated folders to perfom a similar be [![65 - Sequential Matrix](https://github.com/GuillaumeFalourd/poc-github-actions/actions/workflows/65-sequential-matrix.yml/badge.svg)](https://github.com/GuillaumeFalourd/poc-github-actions/actions/workflows/65-sequential-matrix.yml) This workflow illustrates how to execute sequencial jobs in specific order using matrix with `max-parallel: 1` strategy. + +[![66 - Matrix Object](https://github.com/GuillaumeFalourd/poc-github-actions/actions/workflows/66-matrix-object.yml/badge.svg)](https://github.com/GuillaumeFalourd/poc-github-actions/actions/workflows/66-matrix-object.yml) + +This workflow illustrates how to manipulate matrix object to perform different operation according to a object type. + +[![67 - From JSON Env Var](https://github.com/GuillaumeFalourd/poc-github-actions/actions/workflows/67-fromjson-env-var.yml/badge.svg)](https://github.com/GuillaumeFalourd/poc-github-actions/actions/workflows/67-fromjson-env-var.yml) + +This workflow illustrates how to extract a specific item from a JSON list stored in a environment variable dynamically. diff --git a/backup/checkout-workflow.txt b/backup/checkout-workflow.txt index bef0981e80..8da89f601c 100644 --- a/backup/checkout-workflow.txt +++ b/backup/checkout-workflow.txt @@ -1 +1 @@ -Fri Sep 15 01:10:44 UTC 2023 +Mon Sep 18 01:10:12 UTC 2023 diff --git a/backup/pull-request-workflow.txt b/backup/pull-request-workflow.txt index c0f2e4e1d6..c702aebd66 100644 --- a/backup/pull-request-workflow.txt +++ b/backup/pull-request-workflow.txt @@ -1 +1 @@ -Thu Sep 14 06:22:06 UTC 2023 +Fri Sep 15 06:21:44 UTC 2023 diff --git a/ubuntu_report_full_remote.txt b/ubuntu_report_full_remote.txt index c3c6c2c334..b9f9f7edac 100644 --- a/ubuntu_report_full_remote.txt +++ b/ubuntu_report_full_remote.txt @@ -1 +1 @@ -Mon Sep 18 02:12:54 UTC 2023 +Tue Sep 19 02:13:43 UTC 2023