rhysd / actionlint

:octocat: Static checker for GitHub Actions workflow files

Home Page:https://rhysd.github.io/actionlint/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Exclude ${{ insert }} from expression linter

TheFox0x7 opened this issue · comments

on: push
jobs:
  _:
    strategy:
      matrix:
        os:
        - ubuntu-latest
        - macos-latest
        include:
        - os: ubuntu-latest # Only ubuntu-latest has an extra env var MYVAR
          env:
            MYVAR: myval
            MYVAR2: myval2
    env:
      SOME_ENV: B
      ${{ insert }}: ${{ matrix.env || fromjson('{}') }}
    runs-on: ${{ matrix.os }}
    steps:
    - run: env

This workflow currently returns error
job.yaml:16:11: undefined variable "insert". available variables are "env", "github", "inputs", "job", "matrix", "needs", "runner", "secrets", "steps", "strategy", "vars" [expression]

${{ insert }} is an undocumented expression which:

inserts a mapping into a mapping from an expression result.

Related discussion about the expression: go-gitea/gitea#24603 (comment)