actions / actions/runner

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

Open
#2,418 3 comments 13 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug keep
Dominant language
C#
Stars
6.3k
Forks
1.4k
Avg merge
1d 16h
Merged PRs (30d)
24

Description

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: 
      - name: check continue-on-error test 1
        continue-on-error: true
        run: exit 1
      - name: check continue-on-error with variable
        continue-on-error: ${{ github.event_name == 'workflow_dispatch' && inputs.continue }}
        run: exit 1
      - uses: rcmdnk/fail-action@main
        continue-on-error: true
      - uses: rcmdnk/fail-action@main
        continue-on-error: ${{ github.event_name == 'workflow_dispatch' && inputs.continue }}
      - name: last check
        run: ok
  1. Run the workflow manually by checking continue.

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the workflow in .github/workflows/test.yml and the failing composite action definition in action.yml, then reproduce the behavior using the linked example run. Trace how inputs.continue is evaluated for the composite action's continue-on-error step; done means the workflow accepts the expression, continues after the failing action, and reaches the last check.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, github-actions
Domain
ci-cd, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.