[GH-ISSUE #1194] Act job requires 'runs-on' line, which then errors on Github Actions #665

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

Originally created by @codingone21 on GitHub (Jun 1, 2022).
Original GitHub issue: https://github.com/nektos/act/issues/1194

Bug report info

act version:            0.2.26
GOOS:                   darwin
GOARCH:                 arm64
NumCPU:                 8
Docker host:            DOCKER_HOST environment variable is unset/empty.
Sockets found:
        /var/run/docker.sock
Config files:           
        /Users/hannahlee/.actrc:
                -P ubuntu-latest=ghcr.io/catthehacker/ubuntu:act-latest
                -P ubuntu-20.04=ghcr.io/catthehacker/ubuntu:act-20.04
                -P ubuntu-18.04=ghcr.io/catthehacker/ubuntu:act-18.04
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:               aarch64
        OS kernel:             5.10.104-linuxkit
        OS CPU:                4
        OS memory:             7851 MB
        Security options:
                name=seccomp,profile=default
                name=cgroupns

Command used with act

act

Describe issue

There is a discrepency between running 'act' and 'github' actions, specifically when using 'needs'.
When using 'act', it requires that I have 'runs-on', and fails if I don't.
Example:

call-refresh-workflow-passing-data:
    runs-on: ubuntu-latest
    needs: another-job
    if: ${{ needs.compare.outputs.all_modified_files != 0 }}
    uses: ...
    with: ...

When using the actual github actions, I need to remove 'runs-on', otherwise I get an error like below.
Example:

call-refresh-workflow-passing-data:
    needs: another-job
    if: ${{ needs.compare.outputs.all_modified_files != 0 }}
    uses: ...
    with: ...

The error I get when I add 'runs-on' line like the first example: Unexpected value 'uses'... Unexpected value 'with'

No response

Workflow content

# This workflow is stored and called from each repository that contains documentation files
name: call-refresh-doc
on:
  push:
    branches:
      - main

jobs:
  compare:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
      
    - name: Get changed files
      id: changed-files
      uses: tj-actions/changed-files@v19
      with:
        files: |
          docs/**/*.md
          docs/**/*.mdx

    # --- Log all diff info --- 
    - name: Log the files commit SHA if any md/mdx files have diffs
      continue-on-error: true
      if: steps.changed-files.outputs.any_modified == 'true'
      run: |
        for file in ${{ steps.changed-files.outputs.all_modified_files }}; do
          echo "$file was modified" with the commit ${{ github.sha }}
        done
        for file in ${{ steps.changed-files.outputs.added_files }}; do
          echo "$file was added"
        done
        for file in ${{ steps.changed-files.outputs.deleted_files }}; do
          echo "$file was deleted"
        done
        for file in ${{ steps.changed-files.outputs.all_modified_files }}; do
          echo "$file was modified"
        done
    outputs: 
      all_modified_files: ${{ steps.changed-files.outputs.all_modified_files }}
      any_modified: ${{ steps.changed-files.outputs.any_modified }}

  # --- If modified, call refresh --- 
  call-refresh-workflow-passing-data:
    runs-on: ubuntu-latest
    needs: compare
    if: ${{ needs.compare.outputs.all_modified_files != 0 }}
    uses: onflow/flow/.github/workflows/refresh-doc.yml@master
    with:
      contentPaths: ${{ needs.compare.outputs.all_modified_files }}
      repository: ${{ github.event.repository.name }}
      commitSha: ${{ github.sha }}

Relevant log output

The workflow is not valid. .github/workflows/call-refresh-doc.yml (Line: 48, Col: 5): Unexpected value 'uses' .github/workflows/call-refresh-doc.yml (Line: 49, Col: 5): Unexpected value 'with'

Additional information

No response

Originally created by @codingone21 on GitHub (Jun 1, 2022). Original GitHub issue: https://github.com/nektos/act/issues/1194 ### Bug report info ```plain text act version: 0.2.26 GOOS: darwin GOARCH: arm64 NumCPU: 8 Docker host: DOCKER_HOST environment variable is unset/empty. Sockets found: /var/run/docker.sock Config files: /Users/hannahlee/.actrc: -P ubuntu-latest=ghcr.io/catthehacker/ubuntu:act-latest -P ubuntu-20.04=ghcr.io/catthehacker/ubuntu:act-20.04 -P ubuntu-18.04=ghcr.io/catthehacker/ubuntu:act-18.04 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: aarch64 OS kernel: 5.10.104-linuxkit OS CPU: 4 OS memory: 7851 MB Security options: name=seccomp,profile=default name=cgroupns ``` ### Command used with act ```sh act ``` ### Describe issue There is a discrepency between running 'act' and 'github' actions, specifically when using 'needs'. When using '**act**', it requires that I have 'runs-on', and fails if I don't. Example: ``` call-refresh-workflow-passing-data: runs-on: ubuntu-latest needs: another-job if: ${{ needs.compare.outputs.all_modified_files != 0 }} uses: ... with: ... ``` When using the actual **github actions**, I need to remove 'runs-on', otherwise I get an error like below. Example: ``` call-refresh-workflow-passing-data: needs: another-job if: ${{ needs.compare.outputs.all_modified_files != 0 }} uses: ... with: ... ``` The error I get when I add 'runs-on' line like the first example: `Unexpected value 'uses'... Unexpected value 'with'` ### Link to GitHub repository _No response_ ### Workflow content ```yml # This workflow is stored and called from each repository that contains documentation files name: call-refresh-doc on: push: branches: - main jobs: compare: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Get changed files id: changed-files uses: tj-actions/changed-files@v19 with: files: | docs/**/*.md docs/**/*.mdx # --- Log all diff info --- - name: Log the files commit SHA if any md/mdx files have diffs continue-on-error: true if: steps.changed-files.outputs.any_modified == 'true' run: | for file in ${{ steps.changed-files.outputs.all_modified_files }}; do echo "$file was modified" with the commit ${{ github.sha }} done for file in ${{ steps.changed-files.outputs.added_files }}; do echo "$file was added" done for file in ${{ steps.changed-files.outputs.deleted_files }}; do echo "$file was deleted" done for file in ${{ steps.changed-files.outputs.all_modified_files }}; do echo "$file was modified" done outputs: all_modified_files: ${{ steps.changed-files.outputs.all_modified_files }} any_modified: ${{ steps.changed-files.outputs.any_modified }} # --- If modified, call refresh --- call-refresh-workflow-passing-data: runs-on: ubuntu-latest needs: compare if: ${{ needs.compare.outputs.all_modified_files != 0 }} uses: onflow/flow/.github/workflows/refresh-doc.yml@master with: contentPaths: ${{ needs.compare.outputs.all_modified_files }} repository: ${{ github.event.repository.name }} commitSha: ${{ github.sha }} ``` ### Relevant log output ```sh The workflow is not valid. .github/workflows/call-refresh-doc.yml (Line: 48, Col: 5): Unexpected value 'uses' .github/workflows/call-refresh-doc.yml (Line: 49, Col: 5): Unexpected value 'with' ``` ### Additional information _No response_
kerem 2026-03-01 21:45:22 +03:00
  • closed this issue
  • added the
    kind/bug
    label
Author
Owner

@KnisterPeter commented on GitHub (Jun 1, 2022):

Act currently does nice not support reusable workflows.

<!-- gh-comment-id:1144125235 --> @KnisterPeter commented on GitHub (Jun 1, 2022): Act currently does ~~nice~~ not support reusable workflows.
Author
Owner

@10thfloor commented on GitHub (Jun 1, 2022):

@KnisterPeter Can you elaborate on this? Why does act require runs-on, but github does not?

I'm also confused. act does run the reusable workflow, but you have to add the runs-on property.

What are the options then? Manually remove the runs-on when it's time to deploy the action to my repository?

<!-- gh-comment-id:1144137133 --> @10thfloor commented on GitHub (Jun 1, 2022): @KnisterPeter Can you elaborate on this? Why does `act` require `runs-on`, but github does not? I'm also confused. `act` _does_ run the reusable workflow, but you have to add the `runs-on` property. What are the options then? Manually remove the `runs-on` when it's time to deploy the action to my repository?
Author
Owner

@KnisterPeter commented on GitHub (Jun 1, 2022):

As I've said before, reusable workflows are not implemented.
With runs-on it does start to run the job as a regular job and that did not have uses or with keywords.

<!-- gh-comment-id:1144152597 --> @KnisterPeter commented on GitHub (Jun 1, 2022): As I've said before, reusable workflows are not implemented. With runs-on it does start to run the job as a regular job and that did not have uses or with keywords.
Author
Owner

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

Why does act require runs-on, but github does not?

Because GitHub is developing faster than us. Before reusable workflows, there was no option to not have runs-on.

<!-- gh-comment-id:1144424285 --> @catthehacker commented on GitHub (Jun 2, 2022): > Why does `act` require `runs-on`, but github does not? Because GitHub is developing faster than us. Before reusable workflows, there was no option to not have `runs-on`.
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#665
No description provided.