[GH-ISSUE #1216] Parsing of Yaml workflow file fails with valid github action syntax #671

Closed
opened 2026-03-01 21:45:25 +03:00 by kerem · 4 comments
Owner

Originally created by @jazanne on GitHub (Jun 14, 2022).
Original GitHub issue: https://github.com/nektos/act/issues/1216

Bug report info

act version:            0.2.26
GOOS:                   darwin
GOARCH:                 amd64
NumCPU:                 16
Docker host:            DOCKER_HOST environment variable is unset/empty.
Sockets found:
	/var/run/docker.sock
Config files:           
	/Users/jwhite/.actrc:
		-P ubuntu-latest=node:16-buster-slim
		-P ubuntu-20.04=node:16-buster-slim
		-P ubuntu-18.04=node:16-buster-slim
Docker Engine:
	Engine version:        20.10.14
	Engine runtime:        runc
	Cgroup version:        2
	Cgroup driver:         cgroupfs
	Storage driver:        overlay2
	Registry URI:          https://index.docker.io/v1/
	OS:                    Docker Desktop
	OS type:               linux
	OS version:            
	OS arch:               x86_64
	OS kernel:             5.10.104-linuxkit
	OS CPU:                8
	OS memory:             9963 MB
	Security options:
		name=seccomp,profile=default
		name=cgroupns

Command used with act

act -j smoke-test-test -s SDK_KEY=<SOME KEY>

Describe issue

YAML linting of workflow files is too aggressive and doesn't respect valid input

According to GHA docs, an expression is valid for timeout-minutes.

No response

Workflow content

name: Smoke test Production
on: workflow_dispatch

jobs:
  smoke-test-test:
    runs-on: ubuntu-latest
    name: Smoke test production
    steps:
      - name: Checkout GitHub Action Repo
        uses: actions/checkout@v3
        with:
          repository: launchdarkly/gha-flags
          path: .github/actions/gha-flags
      - name: Evaluate flags
        id: flags
        uses: ./gha-flags
        with:
          base-uri: 'https://app.ld.catamorphic.com'
          events-uri: 'https://events.ld.catamorphic.com'
          stream-uri: 'https://stream.ld.catamorphic.com'
          sdk-key: ${{ secrets.LD_SDK_KEY_PROD }}
          flag-keys: |
            gha-smoke-test-timeout
      - name: Checkout
        uses: actions/checkout@v3
      - name: Cypress run
        timeout-minutes: ${{ fromJSON(steps.flags.outputs.gha-smoke-test-timeout) }}
        uses: cypress-io/github-action@v3.1.0 # must be locked because of yarn berry issue
        with:
          # Note: this is used because of cypress yarn berry issue
          # https://github.com/cypress-io/github-action/issues/430#issuecomment-1144054512
          command: yarn dlx cypress@v9 run --headless --record --tag production,smoke --config baseUrl=https://docs.launchdarkly.com,retries=2 --spec cypress/integration/smoke.test.ts --config-file cypress.json
          install-command: yarn install --immutable
          build: yarn build-nav-data
          config: baseUrl=https://docs.launchdarkly.com,retries=2
          wait-on: 'https://docs.launchdarkly.com/home'
        env:
          CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }}
          CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      - name: Check Cypress outcome
        if: steps.cypress.outcome == 'failure' || steps.cypress.outcome == 'cancelled'
        run: exit 1

Relevant log output

DEBU[0000] Loading environment from /Users/jwhite/code/launchdarkly/git-gatsby/.env 
DEBU[0000] Loading secrets from /Users/jwhite/code/launchdarkly/git-gatsby/.secrets 
DEBU[0000] Loading workflows from '/Users/jwhite/code/launchdarkly/git-gatsby/.github/workflows' 
DEBU[0000] Loading workflows recursively                 
DEBU[0000] Found workflow 'smoke-test-prod.yml' in '/Users/jwhite/code/launchdarkly/git-gatsby/.github/workflows/smoke-test-prod.yml' 
DEBU[0000] Reading workflow '/Users/jwhite/code/launchdarkly/git-gatsby/.github/workflows/smoke-test-prod.yml' 
Error: yaml: unmarshal errors:
  line 27: cannot unmarshal !!str `${{ fro...` into int64

Additional information

Is there a work-around to disable linting? It's putting me in a position where I need to do testing on github itself.

Originally created by @jazanne on GitHub (Jun 14, 2022). Original GitHub issue: https://github.com/nektos/act/issues/1216 ### Bug report info ```plain text act version: 0.2.26 GOOS: darwin GOARCH: amd64 NumCPU: 16 Docker host: DOCKER_HOST environment variable is unset/empty. Sockets found: /var/run/docker.sock Config files: /Users/jwhite/.actrc: -P ubuntu-latest=node:16-buster-slim -P ubuntu-20.04=node:16-buster-slim -P ubuntu-18.04=node:16-buster-slim Docker Engine: Engine version: 20.10.14 Engine runtime: runc Cgroup version: 2 Cgroup driver: cgroupfs Storage driver: overlay2 Registry URI: https://index.docker.io/v1/ OS: Docker Desktop OS type: linux OS version: OS arch: x86_64 OS kernel: 5.10.104-linuxkit OS CPU: 8 OS memory: 9963 MB Security options: name=seccomp,profile=default name=cgroupns ``` ### Command used with act ```sh act -j smoke-test-test -s SDK_KEY=<SOME KEY> ``` ### Describe issue YAML linting of workflow files is too aggressive and doesn't respect valid input [According to GHA docs, an expression is valid for timeout-minutes](https://docs.github.com/en/actions/learn-github-actions/expressions#example-returning-a-json-object). ### Link to GitHub repository _No response_ ### Workflow content ```yml name: Smoke test Production on: workflow_dispatch jobs: smoke-test-test: runs-on: ubuntu-latest name: Smoke test production steps: - name: Checkout GitHub Action Repo uses: actions/checkout@v3 with: repository: launchdarkly/gha-flags path: .github/actions/gha-flags - name: Evaluate flags id: flags uses: ./gha-flags with: base-uri: 'https://app.ld.catamorphic.com' events-uri: 'https://events.ld.catamorphic.com' stream-uri: 'https://stream.ld.catamorphic.com' sdk-key: ${{ secrets.LD_SDK_KEY_PROD }} flag-keys: | gha-smoke-test-timeout - name: Checkout uses: actions/checkout@v3 - name: Cypress run timeout-minutes: ${{ fromJSON(steps.flags.outputs.gha-smoke-test-timeout) }} uses: cypress-io/github-action@v3.1.0 # must be locked because of yarn berry issue with: # Note: this is used because of cypress yarn berry issue # https://github.com/cypress-io/github-action/issues/430#issuecomment-1144054512 command: yarn dlx cypress@v9 run --headless --record --tag production,smoke --config baseUrl=https://docs.launchdarkly.com,retries=2 --spec cypress/integration/smoke.test.ts --config-file cypress.json install-command: yarn install --immutable build: yarn build-nav-data config: baseUrl=https://docs.launchdarkly.com,retries=2 wait-on: 'https://docs.launchdarkly.com/home' env: CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }} CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Check Cypress outcome if: steps.cypress.outcome == 'failure' || steps.cypress.outcome == 'cancelled' run: exit 1 ``` ### Relevant log output ```sh DEBU[0000] Loading environment from /Users/jwhite/code/launchdarkly/git-gatsby/.env DEBU[0000] Loading secrets from /Users/jwhite/code/launchdarkly/git-gatsby/.secrets DEBU[0000] Loading workflows from '/Users/jwhite/code/launchdarkly/git-gatsby/.github/workflows' DEBU[0000] Loading workflows recursively DEBU[0000] Found workflow 'smoke-test-prod.yml' in '/Users/jwhite/code/launchdarkly/git-gatsby/.github/workflows/smoke-test-prod.yml' DEBU[0000] Reading workflow '/Users/jwhite/code/launchdarkly/git-gatsby/.github/workflows/smoke-test-prod.yml' Error: yaml: unmarshal errors: line 27: cannot unmarshal !!str `${{ fro...` into int64 ``` ### Additional information Is there a work-around to disable linting? It's putting me in a position where I need to do testing on github itself.
kerem 2026-03-01 21:45:25 +03:00
  • closed this issue
  • added the
    kind/bug
    label
Author
Owner

@catthehacker commented on GitHub (Jun 14, 2022):

It's not linting, it's parsing the yaml

<!-- gh-comment-id:1155385684 --> @catthehacker commented on GitHub (Jun 14, 2022): It's not linting, it's parsing the yaml
Author
Owner

@jazanne commented on GitHub (Jun 14, 2022):

well either way it's incorrect, because it throws an error for valid github workflow syntax.

<!-- gh-comment-id:1155404855 --> @jazanne commented on GitHub (Jun 14, 2022): well either way it's incorrect, because it throws an error for valid github workflow syntax.
Author
Owner

@rainabba commented on GitHub (Nov 29, 2022):

Why was this closed? I'm experiencing the same due to the following, which is valid and used in production workflows.

image

Error: yaml: unmarshal errors:
  line 58: cannot unmarshal !!str `fromJso...` into []interface {}
<!-- gh-comment-id:1331219387 --> @rainabba commented on GitHub (Nov 29, 2022): Why was this closed? I'm experiencing the same due to the following, which is valid and used in production workflows. ![image](https://user-images.githubusercontent.com/553630/204634528-a443749c-00ff-45d6-a066-0a3bc58aa61b.png) ```bash Error: yaml: unmarshal errors: line 58: cannot unmarshal !!str `fromJso...` into []interface {} ```
Author
Owner

@KnisterPeter commented on GitHub (Nov 29, 2022):

You need write valid yaml syntax. Use a yaml linter.

<!-- gh-comment-id:1331357856 --> @KnisterPeter commented on GitHub (Nov 29, 2022): You need write valid yaml syntax. Use a yaml linter.
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#671
No description provided.