Skip to content

secrets variables parsing error #15

@ockam

Description

@ockam

Hi, thank you for the action!

I'm testing it and keep receiving the following error when it tries to parse the secrets:

Run jnus/json-variables@2774d3ea74614517d29d03244839b7056cfa2e8e
Run /home/runner/work/_actions/jnus/json-variables/2774d3ea74614517d2[9](https://github.com/ockam/ga-vars-test/actions/runs/6930834115/job/18851255893#step:2:10)d03244839b7056cfa2e8e/src/Set-JsonVariables.ps1 -scope Dev -configFile .github/variables.json' -secrets '{
ParserError: /home/runner/work/_temp/203fec55-2f29-4d57-90d2-e064229911d2.ps1:3
Line |
   3 |    "github_token": "***",
     |                  ~
     | Unexpected token ':' in expression or statement.

Error: Process completed with exit code 1.

Am I doing something wrong or this is a bug?

Here's my variables ./.github/variables.json:

{
  "Variables": [
    {
      "Name": "HostName",
      "Value": "someDevHostName",
      "Scope": {
        "Environment": ["Dev"]
      }
    },
    {
      "Name": "TOKEN_FROM_SECRETS",
      "Value": "${{secrets.TOKEN_FROM_SECRETS}}",
      "Scope": {}
    }
  ]
}

And my test workflow ./.github/workflows/test.yml:

name: A Test Workflow
on:
  workflow_dispatch:
  push:
    branches:
      - main

jobs:
  echo-vars:
    runs-on: ubuntu-latest
    steps:
      - name: Set environment specific variables
        uses: jnus/json-variables@2774d3ea74614517d29d03244839b7056cfa2e8e
        with:
          scope: Dev
          configFile: .github/variables.json'
          secrets: '${{toJson(secrets)}}'

      - name: Echo
        run: |
          echo "HostName is ${env.HostName}"
          echo "TOKEN_FROM_SECRETS is ${env.TOKEN_FROM_SECRETS}"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions