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