Skip to content

Unclear error message for composite actions with missing "using: composite" #2038

Description

@mikeclayton

Describe the bug

Trying to run a workflow with a composite action that is invalid due to a missing using: composite value gives a cryptic error message:

Error: System.NotSupportedException: ConvertRuns

And the logging output:

##[debug]Evaluating condition for step: 'Run /./.github/actions/myaction'
##[debug]Evaluating: success()
##[debug]Evaluating success:
##[debug]=> true
##[debug]Result: true
##[debug]Starting: Run /./.github/actions/myaction
Error: System.NotSupportedException: ConvertRuns
   at GitHub.Runner.Worker.ActionManifestManager.ConvertRuns(IExecutionContext executionContext, TemplateContext templateContext, TemplateToken inputsToken, String fileRelativePath, MappingToken outputs)
   at GitHub.Runner.Worker.ActionManifestManager.Load(IExecutionContext executionContext, String manifestFile)
Error: Fail to load /home/runner/work/devops-github-runners/devops-github-runners/./.github/actions/myaction/action.yaml

As a newcomer to composite actions (trying to create my first one), I had to look in the runner source code to work out what was wrong with my action.yaml file:

throw new NotSupportedException(nameof(ConvertRuns));

and I then realised it was because I needed to specify a using token or a plugIn token in my action.yaml file.

It ended up being a 30-second fix to my action.yaml file, but a more meaningful error message would have made it much easier to diagnose.

To Reproduce

  1. Create an invalid composite actions yaml file - e.g

.\github\actions\myaction\action.yaml

name: "my composite action"
description: "run a composite action"

runs:
  #using: composite # <--- missing this line
  steps:
    - id: mystep
      shell: bash
      run: |
        echo "hello world"
  1. Invoke the composite action from a workflow

.\github\workflows\myworkflow.yaml

name: myWorkflow
on:
  workflow_dispatch:

jobs:
  myJob:
    runs-on: ubuntu-latest
    steps:
      - id: myAction
        uses: ./.github/actions/myaction
  1. Run the workflow. The following error message is logged to the output because there is no using: composite specified in the action.yaml file:
##[debug]Evaluating condition for step: 'Run /./.github/actions/myAction'
##[debug]Evaluating: success()
##[debug]Evaluating success:
##[debug]=> true
##[debug]Result: true
##[debug]Starting: Run /./.github/actions/myAction
Error: System.NotSupportedException: ConvertRuns
   at GitHub.Runner.Worker.ActionManifestManager.ConvertRuns(IExecutionContext executionContext, TemplateContext templateContext, TemplateToken inputsToken, String fileRelativePath, MappingToken outputs)
   at GitHub.Runner.Worker.ActionManifestManager.Load(IExecutionContext executionContext, String manifestFile)
Error: Fail to load /home/runner/work/devops-github-runners/devops-github-runners/./.github/actions/myAction/action.yaml

Expected behavior
An error message indicating that the action.yaml file is invalid, with a brief description of why it's invalid that will guide the author with how to resolve the problem - at the very least something along the lines of missing 'using' or 'plugIn' field in 'runs' block.

Runner Version and Platform

GitHub-hosted linux runner version 2.294.0

Metadata

Metadata

Assignees

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions