Skip to content

Older versions of jq in the runner break this action #1

@tjgurwara99

Description

@tjgurwara99

In the older versions of jq (specially 1.6 and earlier), we have the problem that:

The fact that jq has keywords such as if and end has various implications, some of which may not be obvious. In particular:

  • in jq 1.6 and earlier, keywords cannot be used in the abbreviated syntax for specifying key-value pairs, e.g. {foo} for {"foo": .foo}
  • in jq 1.6 and earlier, keywords cannot be used to form $-variable names
    The full list of reserved keywords is currently:

and as break catch def elif else end foreach if import include label module or reduce then try

(The list of keywords for any particular version of jq can be derived from the lexer.l file, the “master” version of which is https://github.com/stedolan/jq/blob/master/src/lexer.l)

This causes the following error to occur in certain runners with the following error:

jq: error: syntax error, unexpected label, expecting IDENT or __loc__
{commit_oid: $commit_oid, ref: $ref, coverage_report: $coverage_report, language_name: $language_name, label: $label}
jq: 1 compile error
Error: Process completed with exit code 3

The problem is related to using the label keyword without quotes, which is not ideal.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions