Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

Clarify vars context availability in composite actions

Offen Anfängerfreundlich
#46,232 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
74/100
Issue-Typ
Dokumentation
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
github-actions, typescript
Bereich
documentation

Rechercherichtung

Lies die im Issue verlinkte Referenz zu contexts und den Artikel zu composite actions und prüfe dann, wie diese Seiten im docs-Repository organisiert sind. Stelle klar, dass Werte, die eine composite action benötigt, einschließlich Werten aus vars, über inputs übergeben werden sollten; verwende die Beispiele im Issue, um zu überprüfen, ob die Anleitung auf beiden Seiten konsistent ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

content triage
Code of Conduct
What article on docs.github.com is affected?

https://docs.github.com/en/actions/reference/workflows-and-actions/contexts

https://docs.github.com/en/actions/sharing-automations/creating-actions/creating-a-composite-action

What part(s) of the article would you like to see updated?

The documentation is unclear about whether the vars context is available inside composite actions.

The contexts reference lists vars as an available context, which can reasonably lead users to assume that this works inside a composite action:

runs:
  using: composite
  steps:
    - shell: bash
      run: echo "${{ vars.AWS_REGION }}"

However, the Composite Actions ADR states:

"Composite actions should leverage inputs to get values they need, they will not have full access to the context objects."

There is also an implementation detail documented by a runner collaborator in actions/runner#4311: variables are filtered based on references made directly in the calling job, so a vars reference used only inside a composite action may not be available to the runner.

Could the composite actions documentation explicitly clarify that values required by a composite action should be passed through inputs, including values originating from vars?

For example:

- uses: ./my-action
  with:
    region: ${{ vars.AWS_REGION }}

and then inside the composite action:

${{ inputs.region }}

This would make the relationship between the general contexts documentation and the more limited context availability of composite actions clearer.

Thanks

Additional information

No response

Vorherrschende Sprache
TypeScript
Sterne
21k
Forks
69k
Ø Merge
8 Std. 37 Min.
Gemergte PRs (30 T.)
117

Entwicklungsumgebung

In Codespaces öffnen

Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus github/docs

Alle Issues in github/docs

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.