From 45b265208a1b02ce162d605e6d70cfd6a0a1adb3 Mon Sep 17 00:00:00 2001 From: Matti Schneider Date: Sat, 13 Aug 2022 14:32:18 +0200 Subject: [PATCH] Document dynamic get and output in GitHub Action --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 1b7c2249..030d666a 100644 --- a/README.md +++ b/README.md @@ -223,6 +223,13 @@ If you are using podman with SELinux, you will need to set the shared volume fla uses: mikefarah/yq@master with: cmd: yq -i '.foo.bar = "cool"' 'config.yml' + - name: Get an entry with a variable that might contain dots or spaces + id: get_username + uses: mikefarah/yq@master + with: + cmd: yq '.all.children.["${{ matrix.ip_address }}"].username' ops/inventories/production.yml + - name: Reuse a variable obtained in another step + run: echo ${{ steps.get_username.outputs.result }} ``` See https://mikefarah.gitbook.io/yq/usage/github-action for more.