-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Labels
kind/feature-requestNew feature or requestNew feature or request
Description
Act version
0.2.83
Feature description
Summary
act currently fails schema validation when a workflow job uses a local reusable workflow (relative path). GitHub Actions supports uses: ./.github/workflows/<workflow>.yml at the job level, but act errors before execution with "Unknown Property uses".
Expected Behavior
act should accept and execute workflows that use job-level reusable workflows with relative paths, matching GitHub Actions behavior:
jobs:
test-in-docker:
uses: ./.github/workflows/test-docker.yml
secrets: inherit
with:
image_name: docker-apps-cfgmgr:testActual Behavior
act fails schema validation with the following error:
Error: workflow is not valid. 'release.yaml': Line: 65 Column 5: Failed to match job-factory: Line: 65 Column 5: Unknown Property uses
Line: 66 Column 5: Unknown Property secrets
Line: 67 Column 5: Unknown Property with
Line: 65 Column 5: Failed to match workflow-job: Line: 74 Column 22: Unknown Variable Access env
Line: 75 Column 21: Unknown Variable Access env
Line: 76 Column 25: Unknown Variable Access env
Actions YAML Schema Validation Error detected
Reproduction Steps
- Create a reusable workflow file:
.github/workflows/test-docker.yml
name: Test in Docker (Reusable)
on:
workflow_call:
inputs:
image_name:
description: 'Docker image name for testing'
required: false
type: string
default: 'docker-apps-cfgmgr:test'
dockerfile:
description: 'Path to Dockerfile'
required: false
type: string
default: './docker/Dockerfile'
dockerfile_target:
description: 'Dockerfile target to build'
required: false
type: string
default: 'test'
outputs:
coverage_file:
description: 'Path to coverage XML file'
value: ${{ jobs.test.outputs.coverage_file }}
junit_file:
description: 'Path to JUnit XML file'
value: ${{ jobs.test.outputs.junit_file }}
jobs:
test:
name: test-in-docker
runs-on: ubuntu-22.04
outputs:
coverage_file: ${{ steps.set-outputs.outputs.coverage_file }}
junit_file: ${{ steps.set-outputs.outputs.junit_file }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build and test
run: |
docker build --target ${{ inputs.dockerfile_target }} -f ${{ inputs.dockerfile }} -t ${{ inputs.image_name }} .
docker run ${{ inputs.image_name }}
- name: Set outputs
id: set-outputs
run: |
echo "coverage_file=coverage.xml" >> $GITHUB_OUTPUT
echo "junit_file=junit.xml" >> $GITHUB_OUTPUT- Create a workflow that uses the reusable workflow:
.github/workflows/release.yaml
name: Release Build, Test & Publish
on:
push:
tags:
- '*.*.*'
workflow_dispatch:
jobs:
test-in-docker:
uses: ./.github/workflows/test-docker.yml
secrets: inherit
with:
image_name: docker-apps-cfgmgr:test
dockerfile: ./docker/Dockerfile
dockerfile_target: test
build-and-publish:
needs: test-in-docker
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build and push
run: echo "Building..."- Run
act:
act --event tag --tag v1.0.0- Observe the schema validation error before any jobs execute.
Minimal Reproduction Example
File: .github/workflows/test-reusable.yml
name: Test Reusable Workflow
on:
workflow_call:
inputs:
message:
description: 'Message to print'
required: false
type: string
default: 'Hello from reusable workflow'
jobs:
test-job:
runs-on: ubuntu-latest
steps:
- name: Print message
run: echo "${{ inputs.message }}"File: .github/workflows/main.yml
name: Main Workflow
on:
workflow_dispatch:
jobs:
call-reusable:
uses: ./.github/workflows/test-reusable.yml
with:
message: "Hello from main workflow"Command:
act workflow_dispatchExpected: Workflow executes successfully
Actual: Schema validation error: Unknown Property uses
Context
This feature is important because:
- Reusable workflows are a core GitHub Actions feature - They allow workflows to be modular and DRY (Don't Repeat Yourself)
- Local testing is blocked - Developers cannot test workflows locally that use reusable workflows
- Even targeting a single job fails - Using
act -j <job-name>still validates the entire workflow and fails - Related but distinct from Issue Calling reusable workflow which uses a subworkflow at a relative path in the same repository fails with file not found. #1875 - Issue Calling reusable workflow which uses a subworkflow at a relative path in the same repository fails with file not found. #1875 is about nested reusable workflows (a reusable workflow calling another reusable workflow), while this is about job-level reusable workflows in the main workflow
Environment
actversion: 0.2.83- OS: Linux (Ubuntu, kernel 6.14.0-37-generic)
- Docker version: Docker version 29.1.4, build 0e6fee6
Additional Notes
- This works correctly in GitHub Actions
- This works correctly in Gitea Actions
- The error occurs during schema validation, before any workflow execution
- The workflow structure is valid according to GitHub Actions documentation: https://docs.github.com/en/actions/using-workflows/reusing-workflows#calling-a-reusable-workflow
References
- GitHub Actions Documentation: https://docs.github.com/en/actions/using-workflows/reusing-workflows
- Related Issue Calling reusable workflow which uses a subworkflow at a relative path in the same repository fails with file not found. #1875: Calling reusable workflow which uses a subworkflow at a relative path in the same repository fails with file not found. #1875 (nested reusable workflows - different use case)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
kind/feature-requestNew feature or requestNew feature or request