Skip to content

Commit d474356

Browse files
committed
ci: ensure modified JSON files are detected reliably
1 parent 63e4ac5 commit d474356

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

.github/workflows/cron.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,13 @@ jobs:
4343
run: |
4444
git config --global user.name "github-actions[bot]"
4545
git config --global user.email "github-actions[bot]@users.noreply.github.com"
46-
FILES=$(git diff --name-only --diff-filter=AM HEAD -- docs/v2 | grep '\.json$' || true)
46+
FILES=$(
47+
{
48+
git ls-files -m -- 'docs/v2' | grep '\.json$'
49+
git diff --cached --name-only --diff-filter=AM -- 'docs/v2' | grep '\.json$'
50+
git ls-files --others --exclude-standard -- 'docs/v2' | grep '\.json$'
51+
} | sort -u
52+
)
4753
if [ -n "$FILES" ]; then
4854
git add $FILES
4955
git commit -m "chore: deploy JSON file to docs/v2 [skip ci]" || exit 0

0 commit comments

Comments
 (0)