Skip to content
New issue

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

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

Already on GitHub? # to your account

Can't access item in json #7

Open
kotowick opened this issue Oct 19, 2023 · 0 comments
Open

Can't access item in json #7

kotowick opened this issue Oct 19, 2023 · 0 comments

Comments

@kotowick
Copy link

kotowick commented Oct 19, 2023

So I am trying to use this. I have it running in one job, and using the output method so I can access it in another job.

Now, I can echo the data in the second job. However, I cannot seem to find a way to access any elements inside.

jobs:
  setup:
    name: Setup
    runs-on: ubuntu-latest
    outputs:
      config: ${{ toJson(steps.config.outputs) }}
    steps:
      - name: Checkout
        uses: actions/checkout@v3
      - name: read-config
        uses: pietrobolcato/action-read-yaml@1.1.0
        id: config
        with:
          config: ${{ github.workspace }}/deployment/dev/ca-central-1/config.yaml
      - name: Dump job context
        env:
          JOB_CONTEXT: ${{ toJson(steps.config.outputs) }}
        run: echo "$JOB_CONTEXT"


build:
    name: Build
    runs-on: ubuntu-latest
    needs: setup

    steps:
      - name: Dump job context
         env:
           JOB_CONTEXT: ${{ needs.setup.outputs.config }}
         run: echo "${{  env.JOB_CONTEXT['aws_default_region'] }}"

How can I access "aws_default_region"? I tried 100 ways.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant