Skip to content

Commit 331855b

Browse files
committed
ci(check-files): check for unreachable files
Use the delta script to check for any new unreachable collateral files. This will indicate when files not directly part of the documentation should be cleaned up. Signed-off-by: Randolph Sapp <rs@ti.com>
1 parent d2c388d commit 331855b

File tree

2 files changed

+70
-0
lines changed

2 files changed

+70
-0
lines changed

.github/workflows/check-files.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
---
2+
name: "check_toc_txt"
3+
4+
on:
5+
pull_request:
6+
branches: [master]
7+
paths:
8+
- 'source/**'
9+
10+
defaults:
11+
run:
12+
shell: bash
13+
14+
jobs:
15+
lint:
16+
name: Lint
17+
runs-on: ubuntu-latest
18+
container:
19+
image: ghcr.io/texasinstruments/processor-sdk-doc:latest
20+
options: --entrypoint /bin/bash
21+
permissions:
22+
contents: read
23+
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@v4
27+
28+
- name: Update refs and settings
29+
run: |
30+
git config --global --add safe.directory "$PWD"
31+
git switch -C pr
32+
git fetch --no-tags --depth=1 origin master
33+
git switch master
34+
35+
- name: Run check-files.sh
36+
run: |
37+
# Disable color output
38+
export NO_COLOR=true
39+
40+
# Run the test
41+
bin/delta.sh -a master -b pr -- ./bin/check-files.sh
42+
43+
# Prepare summary
44+
WARNING_COUNT=$(wc -l < _new-warn.log)
45+
if [ "$WARNING_COUNT" -gt "0" ]; then
46+
echo "New issues found with check-files.sh:"
47+
echo '```text'
48+
cat _new-warn.log
49+
echo '```'
50+
else
51+
echo "No new issues found with check-files.sh"
52+
fi >> "$GITHUB_STEP_SUMMARY"
53+
54+
# Prepare the artifacts
55+
mkdir -p ./results
56+
echo "${{ github.event.number }}" > ./results/id
57+
cp "$GITHUB_STEP_SUMMARY" ./results/summary
58+
echo "$(wc -l < _new-warn.log)" > ./results/problem-count
59+
60+
# Exit with error if there are new warnings
61+
[ "$WARNING_COUNT" -eq "0" ]
62+
63+
- name: Save results
64+
uses: actions/upload-artifact@v4
65+
if: always()
66+
with:
67+
name: results
68+
path: results/
69+
retention-days: 1

.github/workflows/comment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
workflows:
77
- rstcheck
88
- check_toc_txt
9+
- check-files
910
types:
1011
- completed
1112

0 commit comments

Comments
 (0)