Title: Expose `strategy` and `matrix` variables in `context` · Issue #615 · actions/github-script · GitHub
Open Graph Title: Expose `strategy` and `matrix` variables in `context` · Issue #615 · actions/github-script
X Title: Expose `strategy` and `matrix` variables in `context` · Issue #615 · actions/github-script
Description: 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: gro...
Open Graph Description: 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: Setti...
X Description: 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: S...
Opengraph URL: https://github.com/actions/github-script/issues/615
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Expose `strategy` and `matrix` variables in `context`","articleBody":"**Is your feature request related to a problem? Please describe.**\n\nI'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:\n\n1. Setting env vars:\n```yml\n# ...\nstrategy:\n matrix:\n group: [1, 2]\nsteps:\n - uses: actions/github-script@v7\n env:\n MATRIX_GROUP: ${{ matrix.group }}\n MATRIX_NUM_GROUPS: ${{ strategy.job-total }}\n with:\n script: |\n const group = parseInt(process.env.MATRIX_GROUP)\n const numGroups = parseInt(process.env.MATRIX_NUM_GROUPS)\n```\n2. Interpolation:\n```yml\n# ...\nstrategy:\n matrix:\n group: [1, 2]\nsteps:\n - uses: actions/github-script@v7\n with:\n script: |\n const group = ${{ matrix.group }}\n const numGroups = ${{ strategy.job-total }}\n```\n\n**Describe the solution you'd like**\nIt would be nice if these were offered somewhere in the `context` object, which seems like an intuitive home for them. Something like...\n\n```yml\n# ...\nstrategy:\n matrix:\n group: [1, 2]\nsteps:\n - uses: actions/github-script@v7\n with:\n script: |\n const group = parseInt(context.strategy.matrix.group)\n const numGroups = context.strategy.totalJobs\n```\n","author":{"url":"https://github.com/tony-pizza","@type":"Person","name":"tony-pizza"},"datePublished":"2025-06-03T17:20:35Z","url":"https://github.com/actions/github-script/issues/615"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:306214d1-6c00-1861-18e8-84ed30973057 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E2F2:361639:29EEDB9:3803A0D:6B01C336 |
| html-safe-nonce | 7383d741992078749ee8e45d95f66b76bc219fce7a5505fff588faba88d7754d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMkYyOjM2MTYzOToyOUVFREI5OjM4MDNBMEQ6NkIwMUMzMzYiLCJ2aXNpdG9yX2lkIjoiMjQwODMyODYyMjk3Nzk1ODcxMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | ee58e66dffee1dae85007789e0760f2f3eeb05890ec2fdfeea61d6ffffc9efaf |
| hovercard-subject-tag | issue:3114813418 |
| github-keyboard-shortcuts | repository,issues,actions,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/actions/github-script/615/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3b69d3573b99df4943e82962316d113a2f79edbfe61eff4832d2be95fe36023a/actions/github-script/issues/615 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3b69d3573b99df4943e82962316d113a2f79edbfe61eff4832d2be95fe36023a/actions/github-script/issues/615 |
| og:image:alt | 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: Setti... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | tony-pizza |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/actions/github-script git https://github.com/actions/github-script.git |
| octolytics-dimension-user_id | 44036562 |
| octolytics-dimension-user_login | actions |
| octolytics-dimension-repository_id | 205262760 |
| octolytics-dimension-repository_nwo | actions/github-script |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 205262760 |
| octolytics-dimension-repository_network_root_nwo | actions/github-script |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width