Skip to content

Commit 8387ab8

Browse files
Add CI to validate required files (#661)
* update the ci to validate the necessary file links * eof * fix doc links ci * improve script to handle file list * udpate instructions * handle file list * remove gg doc for now * Potential fix for code scanning alert no. 16: Workflow does not contain permissions Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> * remove old pubsub sample * add back main readme * revert sample read me * rename the script file * rename the file * add gg file --------- Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent 1f47cf0 commit 8387ab8

File tree

4 files changed

+40
-266
lines changed

4 files changed

+40
-266
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Main Branch Checks
2+
permissions:
3+
contents: read
4+
5+
on:
6+
push:
7+
branches-ignore:
8+
- 'main'
9+
- 'docs'
10+
11+
jobs:
12+
verify-documentation-links:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Verify documentation files and links
17+
# check if the files exists in the repository. The file list is in utils/doc-links.txt.
18+
run: |
19+
missing=0
20+
while read -r file || [ -n "$file" ]; do
21+
if [ ! -f "$file" ]; then
22+
if [ $missing -eq 0 ]; then
23+
echo "❌ Missing files referenced in AWS documentation:"
24+
missing=$((missing + 1))
25+
fi
26+
echo " - $file"
27+
fi
28+
done < utils/ci-aws-doc-links.txt
29+
30+
if [ $missing -ge 1 ]; then
31+
echo "Instructions:"
32+
echo " The above files are required for AWS services or documentations."
33+
echo " Restore missing files or update documentation before merge."
34+
echo " Refer to team wiki "AWS Service and Documentation Links" for details. "
35+
exit 1
36+
else
37+
echo "✅ All documentation-referenced files exist"
38+
fi

samples/pubsub.md

Lines changed: 0 additions & 83 deletions
This file was deleted.

samples/pubsub.py

Lines changed: 0 additions & 183 deletions
This file was deleted.

utils/ci-aws-doc-links.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
samples/mqtt/mqtt5_x509.py
2+
samples/greengrass/basic_discovery.py

0 commit comments

Comments
 (0)