Skip to content
Latchkey

GitHub Actions "Anchors are not currently supported" (YAML anchors)

GitHub Actions does not support YAML anchors (&) and aliases (*). Using them to deduplicate config makes the workflow invalid.

What this error means

The workflow is rejected with "Anchors are not currently supported" at the line using & or *.

github-actions
Invalid workflow file: .github/workflows/ci.yml#L10
Anchors are not currently supported. Remove the anchor 'defaults'

Common causes

Anchor and alias to share config

Defining &defaults and reusing it with *defaults is standard YAML but unsupported here.

Merge keys (<<)

YAML merge keys rely on anchors and are likewise unsupported.

How to fix it

Replace anchors with composites or duplication

  1. Extract shared steps into a composite or reusable workflow.
  2. Use defaults: and env: for shared settings instead of anchors.
.github/workflows/ci.yml
defaults:
  run:
    shell: bash
env:
  NODE_ENV: test

How to prevent it

  • Factor shared logic into composite or reusable workflows.
  • Avoid anchors entirely in Actions YAML.

Frequently asked questions

What causes ""Anchors are not currently supported""?
Defining &defaults and reusing it with *defaults is standard YAML but unsupported here.
How do I fix "Anchors are not currently supported"?
Replace anchors with composites or duplication

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card