Workflow parser rejects documented `cache-mode` key ("Unexpected value 'cache-mode'")
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 80/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- github-actions, typescript, yaml
Research direction
Start by reading workflow-parser/src/workflow-v1.0.json, where the issue says the key is missing, and inspect the workflow and job property definitions. Add support for the documented values at both levels, then verify parsing accepts each value and rejects unsupported ones. The issue provides reproduction workflows and the expected values, but names no test file.
Written by the indexing model from the issue text.
Description
Describe the bug
The workflow parser reports Unexpected value 'cache-mode' for the cache-mode key, at both the workflow level and the job level. cache-mode is documented in the workflow syntax reference (top-level and jobs.<job_id>.cache-mode), with values read, write, write-only and none. The runner already handles it (actions/runner#4538), but cache-mode doesn't appear anywhere in workflow-parser/src/workflow-v1.0.json on main.
To Reproduce
- With this workflow:
or withname: With top-level cache-mode cache-mode: read on: push jobs: a: runs-on: ubuntu-latest steps: - run: echo hicache-mode: writeunderjobs.a. - Parse it with
parseWorkflowfrom@actions/workflow-parser:import { parseWorkflow, NoOperationTraceWriter } from "@actions/workflow-parser"; const r = parseWorkflow({ name: "wf.yml", content }, new NoOperationTraceWriter()); console.log(r.context.errors.getErrors().map(e => e.message)); - See error:
wf.yml (Line: 2, Col: 1): Unexpected value 'cache-mode' wf.yml (Line: 6, Col: 5): Unexpected value 'cache-mode' # job-level case
The same workflows without cache-mode parse with no errors.
Expected behavior
cache-mode is accepted at the workflow and job level, with the value restricted to read, write, write-only or none.
Package/Area
- Expressions
- Workflow Parser
- Language Service
- Language Server
Package Version
@actions/workflow-parser v0.3.61
Additional context
Since the language service validates with this schema, I'd expect the GitHub Actions VS Code extension to show documented cache-mode usage as an error. Other tools have the same gap: actionlint (rhysd/actionlint#745, #762). SchemaStore's github-workflow.json already accepts it.
- Dominant language
- TypeScript
- Stars
- 195
- Forks
- 78
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from actions/languageservices
-
Link provider fails for self-repository referencesPossibly taken @collinstevens claimed this 18 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
actions/languageservices#395 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
actions/languageservices#392 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
actions/languageservices#387 ·
-
Remote secrets are never fetched when the only trigger is `workflow_call`Possibly taken @Hashim1999164 claimed this 92 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
actions/languageservices#386 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
actions/languageservices#373 ·
All issues in actions/languageservices
Similar issues
-
type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
db-ux-design-system/core-web#8856 ·
Maintainers usually reply within 1 day
-
'!' breaking change is lost when the commit also has an empty BREAKING CHANGE footerPossibly taken @wittdennis claimed this today. Openpriority: p3 type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
googleapis/release-please#2971 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 87/100
Maintainers usually reply within 1 day
-
🛠️ dette technique
Difficulty 2/5 1-3 hours Newbie friendliness 61/100
betagouv/mon-entreprise#4752 · 1 comment ·
Maintainers usually reply within 5 days