Clarify vars context availability in composite actions
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
Code of Conduct
- I have read and agree to the GitHub Docs project's 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
Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.
- Enthält ein Dockerfile oder eine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus github/docs
-
triage
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 83/100
Maintainer antworten meist innerhalb von 1 Tag
-
content driver persona triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
Maintainer antworten meist innerhalb von 1 Tag
-
triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
github/docs#46222 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
builder persona content
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
github/docs#46190 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Add user-level custom agent configurationEvtl. vergeben @ashis-baral hat das vor 6 Tagen übernommen. Offenbuilder persona content copilot
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 90/100
Maintainer antworten meist innerhalb von 1 Tag
Ähnliche Issues
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 82/100
siyuan-note/siyuan#20313 ·
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 92/100
alunduil/projects-v2-sync#14 ·
-
Service process inherits the caller's cwd at first use, holding that folder open on Windows (EBUSY)Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
-
DevTools page styles leak into the host app in developmentEvtl. vergeben @onmax hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
nuxt-modules/better-auth#567 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag