Skip to content

data parameter does not support single value (appendData, updateData) #616

@dive-deeper

Description

@dive-deeper

Describe the bug
When using appendData or updateData, providing a single value e.g. "data": [[ 1 ]] is invalid.

To Reproduce
Steps to reproduce the behavior:

  1. Create a workflow that uses updateData and has a single value in a double array in the data field, for example:
jobs:
  test:
    steps:     
       - name: Gsheet action
         uses: jroehl/gsheet.action@v2.1.1
         with:
           spreadsheetId: <id>
           commands: |
             [ 
               {  "command": "updateData", "args": { "worksheetTitle": "test1", "data": [[1]], "range": "B1"}} 
             ]
          env:
            GSHEET_CLIENT_EMAIL: ${{ secrets.GSHEET_CLIENT_EMAIL }}
            GSHEET_PRIVATE_KEY: ${{ secrets.GSHEET_PRIVATE_KEY }}
  1. Execute the workflow
  2. Data validation error occurs: ::error::Check "data" property - has to be supplied as nested array ([["1", "2"], ["3", "4"]]). Admittedly, the error does not come directly from this repo and instead from google-sheet-cli. I took a quick look at the code over there and at first glance it looks ok, so maybe it's got something to do on how the data gets passed over? Just guessing though

Expected behavior
The action should be successful

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Linux (Ubuntu)
  • Version 22.04

Additional context
Adding a second value "solves" the problem, but I think it should be possible to update just one value...
Thank you for the action :)

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