I played around with this a little bit, and since the only re-usable primitive in Github Actions is a step packaged as an "action", the only possible implementation to have an auto-updating matrix is something like this:
jobs:
prepare-node-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: nodejs/ci-config-github-actions@master
id: set-matrix
with:
gte: 10
policy: lts
test:
needs: prepare-node-matrix
strategy:
matrix:
node-version: ${{ fromJson(needs.prepare-node-matrix.outputs.matrix) }}
1️⃣ Which is suuuuuuuper verbose? Did I miss something? What do people do to solve this issue - do they generate actions or smth from templates? Would we need a CLI or smth to help with that generation? I can't imagine someone copy/pasting that across hundreds of repos in an organization?
2️⃣ It also makes wonder if it's worth maintaining an action, when instead of the uses: nodejs/ci-config-github-actions@master block (5 lines) you could run: npx @pkgjs/node-matrix --gte 10 --policy lts instead?
3️⃣ But if we are to keep the action - should we rename the repo to something that follows the action convetion better, e.g. nodejs/version-matrix-action?
I played around with this a little bit, and since the only re-usable primitive in Github Actions is a
steppackaged as an "action", the only possible implementation to have an auto-updating matrix is something like this:1️⃣ Which is suuuuuuuper verbose? Did I miss something? What do people do to solve this issue - do they generate actions or smth from templates? Would we need a CLI or smth to help with that generation? I can't imagine someone copy/pasting that across hundreds of repos in an organization?
2️⃣ It also makes wonder if it's worth maintaining an action, when instead of the
uses: nodejs/ci-config-github-actions@masterblock (5 lines) you couldrun: npx @pkgjs/node-matrix --gte 10 --policy ltsinstead?3️⃣ But if we are to keep the action - should we rename the repo to something that follows the action convetion better, e.g.
nodejs/version-matrix-action?