Expose `strategy` and `matrix` variables in `context`
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 35/100
- Issue-Typ
- Feature
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- github-actions, javascript, typescript
Rechercherichtung
Start with actions/github-script@v7 and trace how the script receives its context object, then compare the available GitHub Actions strategy and matrix values with the requested names. Done means workflow scripts can access the requested values through context, with tests or examples covering matrix and strategy usage.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Is your feature request related to a problem? Please describe.
I'm using a matrix and I want to access matrix- and strategy-related variables in my github-script. The two ways to do that are:
- Setting env vars:
# ...
strategy:
matrix:
group: [1, 2]
steps:
- uses: actions/github-script@v7
env:
MATRIX_GROUP: ${{ matrix.group }}
MATRIX_NUM_GROUPS: ${{ strategy.job-total }}
with:
script: |
const group = parseInt(process.env.MATRIX_GROUP)
const numGroups = parseInt(process.env.MATRIX_NUM_GROUPS)
- Interpolation:
# ...
strategy:
matrix:
group: [1, 2]
steps:
- uses: actions/github-script@v7
with:
script: |
const group = ${{ matrix.group }}
const numGroups = ${{ strategy.job-total }}
Describe the solution you'd like
It would be nice if these were offered somewhere in the context object, which seems like an intuitive home for them. Something like...
# ...
strategy:
matrix:
group: [1, 2]
steps:
- uses: actions/github-script@v7
with:
script: |
const group = parseInt(context.strategy.matrix.group)
const numGroups = context.strategy.totalJobs
- Vorherrschende Sprache
- TypeScript
- Sterne
- 5k
- Forks
- 586
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
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 actions/github-script
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 48/100
actions/github-script#728 ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 52/100
actions/github-script#727 · 1 Reaktion ·
-
{ Offen
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 10/100
actions/github-script#724 ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 55/100
actions/github-script#723 · 1 Kommentar ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 55/100
actions/github-script#714 · 1 Kommentar · 4 Reaktionen ·
Alle Issues in actions/github-script
Ähnliche Issues
-
blocklist removal
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
MetaMask/eth-phishing-detect#296544 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
pastelsky/bundlephobia#1122 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
-
category/development priority/P2 scope/file-operations scope/testing type/enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
-
Enatega Customer and Rider app: Add-ons price is not visible to customer after order is placed. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100