actions / actions/runner

`continue-on-error` cannot evaluate expression on environment variable

Open
#1,492 4 comments 9 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Describe the bug
jobs/continue-on-error cannot use environment variable in expression

To Reproduce
Using an expression in continue-on-error like this:

env:
  fullySupportedScalaVersions: "2.13.6"

  test:
    runs-on: ubuntu-latest

    continue-on-error: ${{ contains(env.fullySupportedScalaVersions, matrix.scalaVersion) }}

example: https://github.com/tek/splain/blob/6b12e57954aae0852e9b948e12ef5637c478b53d/.github/workflows/main.yml

Expected behavior
fullySupportedScalaVersions should be used to interpolate the expression

Runner Version and Platform

Version of your runner: latest

OS of the machine running the runner: ubuntu-latest

What's not working?

Invalid workflow file : .github/workflows/main.yml#L38
The workflow is not valid. .github/workflows/main.yml (Line: 38, Col: 24): Unrecognized named-value: 'env'. Located at position 10 within expression: contains(env.fullySupportedScalaVersions, matrix.scalaVersion) .github/workflows/main.yml (Line: 38, Col: 24): Unexpected value '${{ contains(env.fullySupportedScalaVersions, matrix.scalaVersion) }}'

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

Reproduce the validation error from .github/workflows/main.yml using an expression in continue-on-error that references env.fullySupportedScalaVersions. Start by tracing how that workflow expression is validated, then verify that the environment variable can be used with matrix.scalaVersion. Done means the workflow is accepted and the expression evaluates as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions
Domain
ci-cd
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.