From 435fe1dbc8a4d49556e71f1fe36846149b7953c8 Mon Sep 17 00:00:00 2001 From: Jinu Noh <45530894+yesjinu@users.noreply.github.com> Date: Tue, 24 May 2022 19:22:08 +0900 Subject: [PATCH] docs: enhance README.md --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e48a984..efccf00 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,8 @@ jobs: method: 'POST' username: ${{ secrets.AWX_USER }} password: ${{ secrets.AWX_PASSWORD }} + customHeaders: '{"Authorization": "Bearer ${{ secrets.TOKEN }}", "Content-Type": "application/json"}' + data: '{"key_1": "value_1", "key_2": "value_2"}' ``` ### Versioning @@ -46,7 +48,7 @@ jobs: |---|---| `response` | Response as JSON String -To display HTTP response data in the GitHub Actions log give the request an `id` and access its `outputs` +To display HTTP response data in the GitHub Actions log give the request an `id` and access its `outputs`. You can also access specific field from the response data using [fromJson()](https://docs.github.com/en/actions/learn-github-actions/expressions#fromjson) expression. ```yaml steps: @@ -56,7 +58,9 @@ steps: with: url: "http://yoursite.com/api" - name: Show Response - run: echo ${{ steps.myRequest.outputs.response }} + run: | + echo ${{ steps.myRequest.outputs.response }} + echo ${{ fromJson(steps.myRequest.outputs.response).field_you_want_to_access }} ``` ### Additional Information