GitHub Actions: "Invalid workflow file"
GitHub could not read the workflow file, so it did not start any job from it. One mistake anywhere rejects the whole file: every job in it stops, including the ones that have nothing to do with the line in the message. Other workflow files in the repository are not affected.
What it looks like
- The run fails in 0 seconds with no jobs. It is named after the file path, such as
.github/workflows/ci.yml, not after the workflow'sname:, and the run list says "This run likely failed because of a workflow file issue." - The run page shows the file, the line and the column, and the reason. From a public repository in October (reach #1):
Invalid workflow file: .github/workflows/ci.yml#L1 (Line: 55, Col: 9): Unrecognized function: 'hashFiles'. Located at position 1 within expression: hashFiles('relay-node-android/gradle/wrapper/gradle-wrapper.jar') != '' - A failed run appears on every push, even for a workflow with no
pushtrigger. - A scheduled workflow just stops. One project's nightly sync (
scheduleandworkflow_dispatchonly) last ran on schedule on February 15, 2026, the day a change made the file invalid. By November 2 it had no scheduled run since, about 2,000 failed runs on push, and was still listed as active (OpenHands/docs #987). Another daily sync stopped on October 11 the same way (openchamber-docker #17).
The messages, and what to change
Unrecognized named-value: 'secrets'
From a release workflow in September (TimoDesk #44):
Invalid workflow file (Line: 52, Col: 13): Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets.KEYSTORE_BASE64 != ''
GitHub's documentation says secrets "cannot be directly referenced in if: conditionals." Put the test in the job's env, where secrets is available, and test the variable:
jobs:
release:
runs-on: ubuntu-latest
env:
HAS_KEYSTORE: ${{ secrets.KEYSTORE_BASE64 != '' }}
steps:
- name: Sign
if: env.HAS_KEYSTORE == 'true'
run: ./sign.sh
Unrecognized named-value or function in another key
Each key can use only some contexts and functions, listed in the "Context availability" table of GitHub's contexts reference. Two that come up often:
hashFiles()works in step keys only. In a job'sif:it gives the "Unrecognized function: 'hashFiles'" above. Move the test to the steps'if:.- A job's
envcan usegithub,needs,strategy,matrix,vars,secretsandinputs, but notrunner,env,joborsteps, sorunner.tempthere gives "Unrecognized named-value: 'runner'" (dtctl-ai-bug-demo #100). Set it in a step instead. A job'sif:has even less:github,needs,varsandinputs.
Unexpected symbol
Unexpected symbol: '3dsx' in steps.plan.outputs.3dsx == 'true': a name after a dot cannot start with a digit. The fix in that case was to rename the output to want_3dsx (3ds-GBabe #2).
Unexpected value '...'
A key is in a place that does not take it, often because of its indentation. Unexpected value 'schedule' came from schedule: written inside a job, when it belongs under on: (ChiaEngine #96).
A job that calls a reusable workflow (uses: ./.github/workflows/x.yml) can have only a short list of keys: name, uses, with, secrets, strategy, needs, if, concurrency, permissions and cache-mode. runs-on, env, steps and timeout-minutes go in the called workflow's own jobs. One project's release workflow stopped creating jobs when timeout-minutes was added to such a job (openchamber #118).
'with' is already defined
The same key appears twice in one block, for example a second with: or env: in the same step (hisabkikitab #16). Merge the two into one.
You have an error in your yaml syntax on line N
The file is not valid YAML at all. A common cause is text inside run: | that starts at column 0, such as the body of a heredoc: it ends the block early, and YAML reads the next line as a new key (cornucopia #3688). Indent those lines like the rest of the block. YAML removes that indentation before the shell sees the script, so the heredoc still works.
The nested job is requesting ..., but is only allowed ...
The workflow is not valid. .github/workflows/nightly.yml (Line: 63, Col: 3): Error calling workflow '...'. The nested job 'matrix' is requesting 'id-token: write', but is only allowed 'id-token: none'.
A called workflow can lower the GITHUB_TOKEN permissions it gets from the caller, never raise them, and a scope left out of a permissions block is none. Add the scope to the calling job's permissions. One release broke when contents: write was removed from such a job without adding back contents: read (xlq #145). These runs end as "Startup failure" rather than failing with no jobs, and a scheduled one keeps starting and failing every night (langwatch #9187).
Catching it before you push
actionlint (v1.7.12) checks workflow files on your machine or in CI. It reports most of the mistakes above, for example context "secrets" is not allowed here and unexpected key "schedule" for "job" section, but it does not know what a called workflow needs, so the permissions error is found only by GitHub. Run it from a workflow file of its own: a lint job in the broken file never starts.
name: Lint workflows
on: [push, pull_request]
jobs:
actionlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Check workflow files
run: |
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
./actionlint -color
shell: bash
Telling it apart
- A job started and failed in "Set up job" with "Unable to resolve action": the file is valid, and an action it uses could not be found ("Unable to resolve action").
- Starting it by hand fails with HTTP 422 "Workflow does not have 'workflow_dispatch' trigger": the file is valid, and the copy on that branch has no such trigger (no workflow_dispatch trigger).
- The job ran and a step was refused with "Resource not accessible by integration": the file is valid, and the token lacks a permission at run time ("Resource not accessible by integration").
See failed runs from IntelliJ IDEA
Pipeline Inbox for GitHub Actions Workflows, a plugin by Lesstep for JetBrains IDEs 2024.1 or later, lists the runs of all your repositories in an IDE tool window, with their jobs and steps, and your current branch's runs are in the status bar, so a run that failed with no jobs shows up where you are already working. Reading is free; re-running failed jobs, cancelling, running workflows and reviewing deployments are Pro (US$1.50 a month, with a 30-day trial).
GitHub and GitHub Actions are trademarks of GitHub, Inc.; IntelliJ IDEA is a trademark of JetBrains s.r.o. This page is not affiliated with, sponsored or endorsed by GitHub, Inc. or JetBrains.
More: "Unable to resolve action" · "Resource not accessible by integration" · No workflow_dispatch trigger · The "Unexpected input(s)" warning · GitHub Actions plugins for IntelliJ IDEA compared · 日本語