[GH-ISSUE #1792] triggering workflow from another workflow #872

Closed
opened 2026-03-01 21:47:03 +03:00 by kerem · 2 comments
Owner

Originally created by @ErikEngerd on GitHub (May 8, 2023).
Original GitHub issue: https://github.com/nektos/act/issues/1792

Bug report info

act version:            0.2.45
GOOS:                   linux
GOARCH:                 amd64
NumCPU:                 6
Docker host:            DOCKER_HOST environment variable is not set
Sockets found:
        /var/run/docker.sock
Config files:
        .actrc:
                -P centos:8
Build info:
        Go version:            go1.18.10
        Module path:           github.com/nektos/act
        Main version:          (devel)
        Main path:             github.com/nektos/act
        Main checksum:
        Build settings:
                -compiler:            gc
                -ldflags:             -s -w -X main.version=0.2.45 -X main.commit=f1df2ca5d6b315935cf9bb0d2a989175adf4e894 -X main.date=2023-05-01T02:18:49Z -X main.builtBy=goreleaser
                CGO_ENABLED:          0
                GOARCH:               amd64
                GOOS:                 linux
                GOAMD64:              v1
                vcs:                  git
                vcs.revision:         f1df2ca5d6b315935cf9bb0d2a989175adf4e894
                vcs.time:             2023-05-01T02:18:34Z
                vcs.modified:         false
Docker Engine:
        Engine version:        20.10.21
        Engine runtime:        runc
        Cgroup version:        1
        Cgroup driver:         cgroupfs
        Storage driver:        overlay2
        Registry URI:          https://index.docker.io/v1/
        OS:                    Rancher Desktop WSL Distribution
        OS type:               linux
        OS version:            0.34
        OS arch:               x86_64
        OS kernel:             5.4.72-microsoft-standard-WSL2
        OS CPU:                6
        OS memory:             25661 MB
        Security options:
                name=seccomp,profile=default

Command used with act

act

Describe issue

When a workflow is triggered from another workflow, it does not work. For instance, the following workflow results in an error.

Looking at the code in the main branch (step_factory.go), it looks like remote workflow execution is not implemented. It concerns both StepTypeReusableWorkflowRemote and StepTypeReusableWorkflowLocal.

No response

Workflow content

name: CI
on: [push]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - name: call github.
      uses: ErikEngerd/gh-control-flow/.github/workflows/reusable.yaml@main
      with:
        artifact-name: my-artifact

Relevant log output

`
Error: Unable to determine how to run job:build step:call github
`

Additional information

No response

Originally created by @ErikEngerd on GitHub (May 8, 2023). Original GitHub issue: https://github.com/nektos/act/issues/1792 ### Bug report info ```plain text act version: 0.2.45 GOOS: linux GOARCH: amd64 NumCPU: 6 Docker host: DOCKER_HOST environment variable is not set Sockets found: /var/run/docker.sock Config files: .actrc: -P centos:8 Build info: Go version: go1.18.10 Module path: github.com/nektos/act Main version: (devel) Main path: github.com/nektos/act Main checksum: Build settings: -compiler: gc -ldflags: -s -w -X main.version=0.2.45 -X main.commit=f1df2ca5d6b315935cf9bb0d2a989175adf4e894 -X main.date=2023-05-01T02:18:49Z -X main.builtBy=goreleaser CGO_ENABLED: 0 GOARCH: amd64 GOOS: linux GOAMD64: v1 vcs: git vcs.revision: f1df2ca5d6b315935cf9bb0d2a989175adf4e894 vcs.time: 2023-05-01T02:18:34Z vcs.modified: false Docker Engine: Engine version: 20.10.21 Engine runtime: runc Cgroup version: 1 Cgroup driver: cgroupfs Storage driver: overlay2 Registry URI: https://index.docker.io/v1/ OS: Rancher Desktop WSL Distribution OS type: linux OS version: 0.34 OS arch: x86_64 OS kernel: 5.4.72-microsoft-standard-WSL2 OS CPU: 6 OS memory: 25661 MB Security options: name=seccomp,profile=default ``` ### Command used with act ```sh act ``` ### Describe issue When a workflow is triggered from another workflow, it does not work. For instance, the following workflow results in an error. Looking at the code in the main branch (step_factory.go), it looks like remote workflow execution is not implemented. It concerns both StepTypeReusableWorkflowRemote and StepTypeReusableWorkflowLocal. ### Link to GitHub repository _No response_ ### Workflow content ```yml name: CI on: [push] jobs: build: runs-on: ubuntu-latest steps: - name: call github. uses: ErikEngerd/gh-control-flow/.github/workflows/reusable.yaml@main with: artifact-name: my-artifact ``` ### Relevant log output ```sh ` Error: Unable to determine how to run job:build step:call github ` ``` ### Additional information _No response_
kerem 2026-03-01 21:47:03 +03:00
Author
Owner

@bafulton commented on GitHub (May 15, 2023):

@ErikEngerd, I think I figured it out. In order to trigger a workflow from another workflow, you have to call the workflow inside a job, rather than a step. I was missing a lot of nuance around reusable workflows vs. composite actions. More info here.

Once I swapped to calling the workflow as a separate job instead of a step inside my existing job, act worked like a charm. 👌

<!-- gh-comment-id:1548543927 --> @bafulton commented on GitHub (May 15, 2023): @ErikEngerd, I think I figured it out. In order to trigger a workflow from another workflow, you have to call the workflow inside a _job_, rather than a step. I was missing a lot of nuance around reusable workflows vs. composite actions. More info [here](https://stackoverflow.com/questions/75733616/github-actions-how-to-call-a-reusable-workflow-as-a-step). Once I swapped to calling the workflow as a separate job instead of a step inside my existing job, `act` worked like a charm. 👌
Author
Owner

@github-actions[bot] commented on GitHub (Nov 12, 2023):

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

<!-- gh-comment-id:1806951207 --> @github-actions[bot] commented on GitHub (Nov 12, 2023): Issue is stale and will be closed in 14 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#872
No description provided.