ci/update-other: generate branch list from version-info

Uses a sparse-checkout to download only the `version-info.toml` file,
then uses the `yq-go` action to extract the "other" branches as a JSON
array.
This commit is contained in:
Matt Sturgeon 2025-06-11 23:07:45 +01:00
parent 7e02029af6
commit d9a4a56dcf

View file

@ -15,17 +15,21 @@ jobs:
runs-on: ubuntu-24.04-arm
if: github.repository == 'nix-community/nixvim'
outputs:
branches: ${{ steps.list-branches.outputs.branches }}
branches: ${{ steps.list-branches.outputs.result }}
steps:
- name: Checkout version-info
uses: actions/checkout@v4
with:
sparse-checkout: version-info.toml
sparse-checkout-cone-mode: false
- name: List stable branches
id: list-branches
run: |
echo 'branches<<EOF
[
"nixos-25.05",
"nixos-24.11"
]
EOF' >> "$GITHUB_OUTPUT"
uses: mikefarah/yq@master
with:
cmd: |
yq --no-colors --output-format=json \
'[ .versions[].branch | select(. != "main") ]' \
version-info.toml
update:
name: Trigger update on ${{ matrix.branch }}
runs-on: ubuntu-24.04-arm