Skip to content

Commit d9a4a56

Browse files
committed
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.
1 parent 7e02029 commit d9a4a56

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

.github/workflows/update-other.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,21 @@ jobs:
1515
runs-on: ubuntu-24.04-arm
1616
if: github.repository == 'nix-community/nixvim'
1717
outputs:
18-
branches: ${{ steps.list-branches.outputs.branches }}
18+
branches: ${{ steps.list-branches.outputs.result }}
1919
steps:
20+
- name: Checkout version-info
21+
uses: actions/checkout@v4
22+
with:
23+
sparse-checkout: version-info.toml
24+
sparse-checkout-cone-mode: false
2025
- name: List stable branches
2126
id: list-branches
22-
run: |
23-
echo 'branches<<EOF
24-
[
25-
"nixos-25.05",
26-
"nixos-24.11"
27-
]
28-
EOF' >> "$GITHUB_OUTPUT"
27+
uses: mikefarah/yq@master
28+
with:
29+
cmd: |
30+
yq --no-colors --output-format=json \
31+
'[ .versions[].branch | select(. != "main") ]' \
32+
version-info.toml
2933
update:
3034
name: Trigger update on ${{ matrix.branch }}
3135
runs-on: ubuntu-24.04-arm

0 commit comments

Comments
 (0)