Skip to content

Commit 3412f2a

Browse files
Oreoxmtti-chi-bot
authored andcommitted
This is an automated cherry-pick of pingcap#21669
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
1 parent 7d344c7 commit 3412f2a

11 files changed

Lines changed: 809 additions & 3 deletions

.github/workflows/ci.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Check out
14+
<<<<<<< HEAD
1415
uses: actions/checkout@v3
1516
- uses: actions/setup-node@v3
1617
with:
@@ -21,3 +22,53 @@ jobs:
2122
run: ./scripts/verify-links.sh
2223
- name: Verify internal link anchors
2324
run: ./scripts/verify-link-anchors.sh
25+
=======
26+
uses: actions/checkout@v6
27+
- name: Verify duplicated file names
28+
run: ./scripts/verify-duplicated-file-name.sh
29+
30+
internal-links-files:
31+
runs-on: ubuntu-latest
32+
steps:
33+
- name: Check out
34+
uses: actions/checkout@v6
35+
- uses: actions/setup-node@v6
36+
with:
37+
node-version: "18"
38+
cache: npm
39+
cache-dependency-path: package-lock.json
40+
- name: Install Node dependencies
41+
run: npm ci
42+
- name: Verify internal links (full repo) - files
43+
run: ./scripts/verify-links.sh
44+
45+
internal-links-anchors:
46+
runs-on: ubuntu-latest
47+
steps:
48+
- name: Check out
49+
uses: actions/checkout@v6
50+
- uses: actions/setup-node@v6
51+
with:
52+
node-version: "18"
53+
cache: npm
54+
cache-dependency-path: package-lock.json
55+
- name: Install Node dependencies
56+
run: npm ci
57+
- name: Verify internal links (full repo) - anchors
58+
run: ./scripts/verify-link-anchors.sh
59+
60+
internal-links-toc:
61+
runs-on: ubuntu-latest
62+
steps:
63+
- name: Check out
64+
uses: actions/checkout@v6
65+
- uses: actions/setup-node@v6
66+
with:
67+
node-version: "18"
68+
cache: npm
69+
cache-dependency-path: package-lock.json
70+
- name: Install Node dependencies
71+
run: npm ci
72+
- name: Verify internal links (full repo) - TOC membership
73+
run: node ./scripts/verify-internal-links-in-toc.js
74+
>>>>>>> 53219fc7df (ci: update actions (#21669))

.github/workflows/doc_review.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: AI Doc Review
2+
3+
on:
4+
workflow_dispatch:
5+
6+
issue_comment:
7+
types:
8+
- created
9+
10+
permissions:
11+
contents: read
12+
pull-requests: write
13+
issues: write
14+
15+
jobs:
16+
review:
17+
runs-on: ubuntu-latest
18+
if: >
19+
github.event_name == 'workflow_dispatch' ||
20+
(
21+
github.event_name == 'issue_comment' &&
22+
contains(github.event.comment.body, '/bot-review') &&
23+
(github.event.comment.user.login == 'hfxsd' || github.event.comment.user.login == 'likidu' || github.event.comment.user.login == 'lilin90' || github.event.comment.user.login == 'Oreoxmt' || github.event.comment.user.login == 'qiancai')
24+
)
25+
steps:
26+
27+
- name: Checkout Repo
28+
uses: actions/checkout@v6
29+
with:
30+
fetch-depth: 0 # Fetch all history for all branches and tags
31+
32+
- name: Extract review parameters
33+
id: extract
34+
if: github.event_name == 'issue_comment'
35+
run: |
36+
COMMENT="${{ github.event.comment.body }}"
37+
38+
# Match commit range
39+
if [[ "$COMMENT" =~ \/bot-review:[[:space:]]*([a-f0-9]{7,40})[[:space:]]*\.\.[[:space:]]*([a-f0-9]{7,40}) ]]; then
40+
echo "BASE_SHA=${BASH_REMATCH[1]}" >> $GITHUB_OUTPUT
41+
echo "HEAD_SHA=${BASH_REMATCH[2]}" >> $GITHUB_OUTPUT
42+
echo "REVIEW_MODE=commit_range" >> $GITHUB_OUTPUT
43+
printf "Detected commit range with regex: %s..%s\\n" "${BASH_REMATCH[1]}" "${BASH_REMATCH[2]}"
44+
45+
# Match a single commit
46+
elif [[ "$COMMENT" =~ \/bot-review:[[:space:]]+([a-f0-9]{7,40}) ]]; then
47+
echo "COMMIT_SHA=${BASH_REMATCH[1]}" >> $GITHUB_OUTPUT
48+
echo "REVIEW_MODE=single_commit" >> $GITHUB_OUTPUT
49+
printf "Detected single commit: %s\\n" "${BASH_REMATCH[1]}"
50+
51+
# Match "/bot-review" or "/bot-review "
52+
elif [[ "$COMMENT" =~ ^\/bot-review[[:space:]]*$ ]]; then
53+
echo "REVIEW_MODE=latest" >> $GITHUB_OUTPUT
54+
echo "Detected default review mode"
55+
56+
# Invalid format
57+
else
58+
echo "REVIEW_MODE=invalid" >> $GITHUB_OUTPUT
59+
echo "Invalid bot-review command format"
60+
fi
61+
62+
echo "Parameters output:"
63+
cat $GITHUB_OUTPUT
64+
65+
- name: AI Doc Reviewer
66+
uses: qiancai/ai-doc-reviewer@main
67+
continue-on-error: false # Ensure workflow fails if the action fails
68+
with:
69+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
70+
API_PROVIDER: "deepseek" # or "openai" if you want to use OpenAI
71+
DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }}
72+
DEEPSEEK_API_MODEL: "deepseek-chat" # Updated model name
73+
exclude: "**/*.json" # Optional: exclude patterns separated by commas
74+
REVIEW_MODE: ${{ steps.extract.outputs.REVIEW_MODE || 'default' }}
75+
COMMIT_SHA: ${{ steps.extract.outputs.COMMIT_SHA || '' }}
76+
BASE_SHA: ${{ steps.extract.outputs.BASE_SHA || '' }}
77+
HEAD_SHA: ${{ steps.extract.outputs.HEAD_SHA || '' }}
78+
PROMPT_PATH: "doc-review-prompt.txt"

.github/workflows/flush-version.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,13 @@ jobs:
2525
name: Flush PDF by Version
2626
runs-on: ubuntu-latest
2727
steps:
28+
<<<<<<< HEAD
2829
- name: install qiniu qshell
2930
uses: foxundermoon/setup-qshell@v5
31+
=======
32+
- name: Set up Python environment
33+
uses: actions/setup-python@v6
34+
>>>>>>> 53219fc7df (ci: update actions (#21669))
3035
with:
3136
version: '2.6.2'
3237

.github/workflows/flush.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,13 @@ jobs:
1010
name: Flush PDF
1111
runs-on: ubuntu-latest
1212
steps:
13+
<<<<<<< HEAD
1314
- name: install qiniu qshell
1415
uses: foxundermoon/setup-qshell@v5
16+
=======
17+
- name: Set up Python environment
18+
uses: actions/setup-python@v6
19+
>>>>>>> 53219fc7df (ci: update actions (#21669))
1520
with:
1621
version: '2.6.2'
1722

.github/workflows/link-fail-fast.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,18 @@ jobs:
1717
CHANGED_FILES=$(git diff-tree --name-only --diff-filter 'AM' -r HEAD^1 HEAD -- "*.md" | sed -z "s/\n$//;s/\n/' '/g")
1818
echo "all_changed_files=${CHANGED_FILES}" >> $GITHUB_OUTPUT
1919
20+
<<<<<<< HEAD
2021
- name: Download Exclude Path
2122
run: |
2223
curl https://raw.githubusercontent.com/pingcap/docs/master/.lycheeignore -O
24+
=======
25+
- name: Restore lychee cache
26+
uses: actions/cache@v5
27+
with:
28+
path: .lycheecache
29+
key: cache-lychee-${{ github.sha }}
30+
restore-keys: cache-lychee-
31+
>>>>>>> 53219fc7df (ci: update actions (#21669))
2332

2433
- name: Link Checker
2534
if: ${{ steps.changed-files.outputs.all_changed_files }}

.github/workflows/link.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,16 @@ jobs:
1616
run: |
1717
curl https://raw.githubusercontent.com/pingcap/docs/master/.lycheeignore --output .lycheeignore
1818
19+
<<<<<<< HEAD
20+
=======
21+
- name: Restore lychee cache
22+
uses: actions/cache@v5
23+
with:
24+
path: .lycheecache
25+
key: cache-lychee-${{ github.sha }}
26+
restore-keys: cache-lychee-
27+
28+
>>>>>>> 53219fc7df (ci: update actions (#21669))
1929
- name: Check Links
2030
uses: lycheeverse/lychee-action@v1.6.1
2131
with:

.github/workflows/media.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ jobs:
1111
name: Upload media files
1212
runs-on: ubuntu-latest
1313
steps:
14+
<<<<<<< HEAD
1415
- uses: actions/checkout@v3
16+
=======
17+
- uses: actions/checkout@v6
18+
>>>>>>> 53219fc7df (ci: update actions (#21669))
1519
with:
1620
# Must use at least depth 2!
1721
fetch-depth: 2
@@ -60,10 +64,10 @@ jobs:
6064
TENCENTCLOUD_SECRET_KEY: ${{ secrets.TENCENTCLOUD_SECRET_KEY }}
6165
steps:
6266
- name: Checkout repository
63-
uses: actions/checkout@v4
67+
uses: actions/checkout@v6
6468

6569
- name: Set up Python environment
66-
uses: actions/setup-python@v5
70+
uses: actions/setup-python@v6
6771
with:
6872
python-version: '3.12'
6973
architecture: 'x64'

.github/workflows/prevent-deletion.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- name: Checkout base
18-
uses: actions/checkout@v4
18+
uses: actions/checkout@v6
1919
with:
2020
fetch-depth: 0
2121
- name: Fetch head

.github/workflows/rebase.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: Checkout the latest code
12+
<<<<<<< HEAD
1213
uses: actions/checkout@v3
14+
=======
15+
uses: actions/checkout@v6
16+
>>>>>>> 53219fc7df (ci: update actions (#21669))
1317
with:
1418
token: ${{ secrets.REBASE_SECRET_KEY }}
1519
fetch-depth: 0 # otherwise, you will fail to push refs to dest repo

0 commit comments

Comments
 (0)