Skip to content

Commit c216291

Browse files
committed
build: fix change detection
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 28febf0 commit c216291

File tree

3 files changed

+29
-16
lines changed

3 files changed

+29
-16
lines changed

.github/workflows/markdown_equations.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,16 @@ jobs:
118118
run: |
119119
make markdown-svg-equations-files FILES="${{ steps.changed.outputs.files }}"
120120
121-
if [[ -z "$(git status --porcelain)" ]]; then
122-
# If no files were changed, exit with a success status code:
121+
# Stage *all* tracked and untracked changes first…
122+
git add -A
123+
124+
if git diff --cached --quiet; then
123125
echo "changed=false" >> $GITHUB_OUTPUT
126+
127+
# Exit with a success status code:
124128
exit 0
125129
else
126-
# Otherwise, add changed files to the staging area and commit:
127-
git add -A && git commit -m "docs: update Markdown equation SVGs"
130+
git commit -m "docs: update Markdown equation SVGs"
128131
echo "changed=true" >> $GITHUB_OUTPUT
129132
fi
130133
timeout-minutes: 15
@@ -136,13 +139,16 @@ jobs:
136139
make markdown-img-equations-files FILES="${{ steps.changed.outputs.files }}"
137140
make markdown-img-equations-src-urls-files FILES="${{ steps.changed.outputs.files }}"
138141
139-
if [[ -z "$(git status --porcelain)" ]]; then
140-
# If no files were changed, exit with a success status code:
142+
# Stage *all* tracked and untracked changes first…
143+
git add -A
144+
145+
if git diff --cached --quiet; then
141146
echo "changed=false" >> $GITHUB_OUTPUT
147+
148+
# Exit with a success status code:
142149
exit 0
143150
else
144-
# Otherwise, add changed files to the staging area and commit:
145-
git add -A && git commit -m "docs: update Markdown equation elements"
151+
git commit -m "docs: update Markdown equation elements"
146152
echo "changed=true" >> $GITHUB_OUTPUT
147153
fi
148154
timeout-minutes: 15

.github/workflows/markdown_pkg_urls.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,16 @@ jobs:
124124
run: |
125125
make markdown-pkg-urls MARKDOWN_FILTER='.*/lib/node_modules/@stdlib/.*'
126126
127-
if [[ -z "$(git status --porcelain)" ]]; then
128-
# If no files were changed, exit with a success status code:
127+
# Stage *all* tracked and untracked changes first…
128+
git add -A
129+
130+
if git diff --cached --quiet; then
129131
echo "changed=false" >> $GITHUB_OUTPUT
132+
133+
# Exit with a success status code:
130134
exit 0
131135
else
132-
# Otherwise, add changed files to the staging area and commit:
133-
git add -A && git commit -m "docs: update package URLs"
136+
git commit -m "docs: update package URLs"
134137
echo "changed=true" >> $GITHUB_OUTPUT
135138
fi
136139
timeout-minutes: 10

.github/workflows/markdown_related_packages.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,17 @@ jobs:
135135
make markdown-related-files FILES="${files}"
136136
make markdown-pkg-urls-files FILES="${files}"
137137
138-
if [[ -z "$(git status --porcelain)" ]]; then
139-
# If no files were changed, exit with a success status code:
138+
# Stage *all* tracked and untracked changes first…
139+
git add -A
140+
141+
# If the index is identical to HEAD, nothing real changed:
142+
if git diff --cached --quiet; then
140143
echo "changed=false" >> $GITHUB_OUTPUT
144+
145+
# Exit with a success status code:
141146
exit 0
142147
else
143-
# Otherwise, add changed files to the staging area and commit:
144-
git add -A && git commit -m "docs: update related packages sections"
148+
git commit -m "docs: update related packages sections"
145149
echo "changed=true" >> $GITHUB_OUTPUT
146150
fi
147151
timeout-minutes: 10

0 commit comments

Comments
 (0)