mirror of
https://github.com/nix-community/home-manager.git
synced 2026-06-05 21:02:51 +00:00
ci: fix module count output
Commit 3c71cec05d changed the labeler workflow to use grep -c, but grep -c still exits with status 1 when no lines match.
That made the fallback echo another 0, so COUNT became a multi-line value and the write to GITHUB_OUTPUT failed. Use true as the fallback to preserve grep's single-line count while allowing the no-match case.
This commit is contained in:
2
.github/workflows/labeler.yml
vendored
2
.github/workflows/labeler.yml
vendored
@@ -24,7 +24,7 @@ jobs:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
PR_NUMBER: ${{ github.event.pull_request.number }}
|
||||
run: |
|
||||
COUNT=$(gh api "repos/${{ github.repository }}/pulls/$PR_NUMBER/files" --paginate --jq '.[].filename' | grep -c '^modules/' || echo 0)
|
||||
COUNT=$(gh api "repos/${{ github.repository }}/pulls/$PR_NUMBER/files" --paginate --jq '.[].filename' | grep -c '^modules/' || true)
|
||||
echo "Found $COUNT changed module files."
|
||||
echo "count=$COUNT" >> "$GITHUB_OUTPUT"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user