[GH-ISSUE #273] Incorrect encoding in step output #191

Closed
opened 2026-03-01 21:41:04 +03:00 by kerem · 1 comment
Owner

Originally created by @mrjackdavis on GitHub (Jun 10, 2020).
Original GitHub issue: https://github.com/nektos/act/issues/273

It appears steps.x.output is not encoded correctly.

The example below works perfectly fine in Github actions. But in act, jq throws the error:

parse error: Invalid numeric literal at line 1, column 5

Further inspection with jq -R suggest there is an encoding issue. Such a command outputs a string littered with %!A(MISSING). See below:

{%!A(MISSING)  \"ref\": \"refs/heads/master\",%!A(MISSING)  \"node_id\": \"REDACTED\",%!A(MISSING)  \"url\": \"https://api.github.com/repos/REDACTED/git/refs/heads/master\",%!A(MISSING)  \"object\": {%!A(MISSING)    \"sha\": \"REDACTED\",%!A(MISSING)    \"type\": \"commit\",%!A(MISSING)    \"url\": \"https://api.github.com/repos/REDACTED/git/commits/REDACTED\"%!A(MISSING)  }%!A(MISSING)}

I expect there is an issue with multiline output. I think %0A exists in the output and is being inadvertantly operated upon

Example workflow

name: Tag master

on:
  - push

jobs:
  tag-master:
    runs-on: ubuntu-latest
    name: "tag-master"
    steps:
      - uses: octokit/request-action@v2.0.6
        id: get_master_ref
        with:
          route: GET /repos/:repository/git/ref/heads/master
          repository: ${{ github.repository }}
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      - run: "echo '${{ steps.get_master_ref.outputs.data }}' | jq"
Originally created by @mrjackdavis on GitHub (Jun 10, 2020). Original GitHub issue: https://github.com/nektos/act/issues/273 It appears `steps.x.output` is not encoded correctly. The example below works perfectly fine in Github actions. But in `act`, `jq` throws the error: ``` parse error: Invalid numeric literal at line 1, column 5 ``` Further inspection with `jq -R` suggest there is an encoding issue. Such a command outputs a string littered with `%!A(MISSING)`. See below: ``` {%!A(MISSING) \"ref\": \"refs/heads/master\",%!A(MISSING) \"node_id\": \"REDACTED\",%!A(MISSING) \"url\": \"https://api.github.com/repos/REDACTED/git/refs/heads/master\",%!A(MISSING) \"object\": {%!A(MISSING) \"sha\": \"REDACTED\",%!A(MISSING) \"type\": \"commit\",%!A(MISSING) \"url\": \"https://api.github.com/repos/REDACTED/git/commits/REDACTED\"%!A(MISSING) }%!A(MISSING)} ``` I expect there is an issue with multiline output. I think `%0A` exists in the output and is being inadvertantly operated upon # Example workflow ``` name: Tag master on: - push jobs: tag-master: runs-on: ubuntu-latest name: "tag-master" steps: - uses: octokit/request-action@v2.0.6 id: get_master_ref with: route: GET /repos/:repository/git/ref/heads/master repository: ${{ github.repository }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: "echo '${{ steps.get_master_ref.outputs.data }}' | jq" ```
kerem 2026-03-01 21:41:04 +03:00
  • closed this issue
  • added the
    stale
    label
Author
Owner

@github-actions[bot] commented on GitHub (Aug 10, 2020):

Issue is stale and will be closed in 7 days unless there is new activity

<!-- gh-comment-id:671119613 --> @github-actions[bot] commented on GitHub (Aug 10, 2020): Issue is stale and will be closed in 7 days unless there is new activity
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#191
No description provided.