actions / runner

The Runner for GitHub Actions :rocket:
https://github.com/features/actions
MIT License
4.89k stars 959 forks source link

continue-on-error on composite actions does not work with inputs variables. #2418

Open rcmdnk opened 1 year ago

rcmdnk commented 1 year ago

Describe the bug When continue-on-error flag is used on composite actions, it seems the variables are passed to the composite actions and evaluated in there.

As a result, if the workflow uses the inputs variables for the continue-on-error, the variable is not recognized in the comoposite action.

To Reproduce Steps to reproduce the behavior:

  1. Make a compoosite action which fails: https://github.com/rcmdnk/fail-action/blob/81594b3cffd3dd376eb64c70d3a3b25c094cf64a/action.yml
  2. Make workflow like:
    
    name: test

on: workflow_dispatch: inputs: continue: type: boolean required: false default: false

jobs:
test: runs-on: ubuntu-latest steps:

Expected behavior If inputs.continue is true, all steps must be executed.

Runner Version and Platform

ubuntu-latest, macos-12

What's not working?

The workflow stops before last check.

Job Log Output

The step continue-on-error flag with inputs.continue on uses: rcmdnk/fail-action@main shows error like:

##[debug]Expanded: (('workflow_dispatch' == 'workflow_dispatch') && null)
##[debug]Result: null
Error: .github/workflows/test.yml (Line: 24, Col: 28): Unexpected value ''
Error: The step failed and an error occurred when attempting to determine whether to continue on error.
Error: The template is not valid. .github/workflows/test.yml (Line: 24, Col: 28): Unexpected value ''
##[debug]GitHub.DistributedTask.ObjectTemplating.TemplateValidationException: The template is not valid. .github/workflows/test.yml (Line: 24, Col: 28): Unexpected value ''

and it stops there and last check is not executed.

Example run: https://github.com/rcmdnk/composite-continue-on-error-test/actions/runs/4095530933

JamesMGreene commented 1 year ago

I wonder if its using the composite action's set of inputs instead? πŸ€”

As a potential workaround, you could try using github.event.inputs.continue here instead since you're trying to get a workflow-level input.

vineethvijay7 commented 6 months ago

Is this really solved? I can't get this to work in my pipeline yet

EDIT: This solution https://github.com/actions/runner/issues/1492 works πŸ‘