Skip to content

Commit 22f68df

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 9784ab4 commit 22f68df

11 files changed

Lines changed: 141 additions & 20 deletions

.github/workflows/ci.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Check out
14-
uses: actions/checkout@v4
14+
uses: actions/checkout@v6
1515
- name: Verify duplicated file names
1616
run: ./scripts/verify-duplicated-file-name.sh
1717

1818
internal-links-files:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- name: Check out
22-
uses: actions/checkout@v4
23-
- uses: actions/setup-node@v4
22+
uses: actions/checkout@v6
23+
- uses: actions/setup-node@v6
2424
with:
2525
node-version: "18"
2626
cache: npm
@@ -34,8 +34,8 @@ jobs:
3434
runs-on: ubuntu-latest
3535
steps:
3636
- name: Check out
37-
uses: actions/checkout@v4
38-
- uses: actions/setup-node@v4
37+
uses: actions/checkout@v6
38+
- uses: actions/setup-node@v6
3939
with:
4040
node-version: "18"
4141
cache: npm
@@ -49,8 +49,8 @@ jobs:
4949
runs-on: ubuntu-latest
5050
steps:
5151
- name: Check out
52-
uses: actions/checkout@v4
53-
- uses: actions/setup-node@v4
52+
uses: actions/checkout@v6
53+
- uses: actions/setup-node@v6
5454
with:
5555
node-version: "18"
5656
cache: npm

.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: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,16 @@ 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
21+
=======
22+
- name: Restore lychee cache
23+
uses: actions/cache@v5
24+
with:
25+
path: .lycheecache
26+
key: cache-lychee-${{ github.sha }}
27+
restore-keys: cache-lychee-
28+
29+
>>>>>>> 53219fc7df (ci: update actions (#21669))
2030
- name: Link Checker
2131
if: ${{ steps.changed-files.outputs.all_changed_files }}
2232
uses: lycheeverse/lychee-action@v2.3.0

.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: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
name: Upload media files
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v4
14+
- uses: actions/checkout@v6
1515
with:
1616
# Must use at least depth 2!
1717
fetch-depth: 2
@@ -60,10 +60,10 @@ jobs:
6060
TENCENTCLOUD_SECRET_KEY: ${{ secrets.TENCENTCLOUD_SECRET_KEY }}
6161
steps:
6262
- name: Checkout repository
63-
uses: actions/checkout@v4
63+
uses: actions/checkout@v6
6464

6565
- name: Set up Python environment
66-
uses: actions/setup-python@v5
66+
uses: actions/setup-python@v6
6767
with:
6868
python-version: '3.12'
6969
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: Checkout the latest code
12-
uses: actions/checkout@v4
12+
uses: actions/checkout@v6
1313
with:
1414
token: ${{ secrets.REBASE_SECRET_KEY }}
1515
fetch-depth: 0 # otherwise, you will fail to push refs to dest repo

.github/workflows/sync-ai-docs-en-to-zh.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,21 +42,21 @@ jobs:
4242
pull-requests: write
4343

4444
steps:
45-
- uses: actions/checkout@v4
45+
- uses: actions/checkout@v6
4646
name: Checkout docs-cn
4747
with:
4848
ref: ${{ env.DOCS_CN_BASE }}
4949
path: docs-cn
5050
fetch-depth: 0
5151

52-
- uses: actions/checkout@v4
52+
- uses: actions/checkout@v6
5353
name: Checkout ai-pr-translator
5454
with:
5555
repository: ${{ env.AI_TRANSLATOR_REPO }}
5656
ref: ${{ env.AI_TRANSLATOR_REF }}
5757
path: ai-pr-translator
5858

59-
- uses: actions/setup-python@v5
59+
- uses: actions/setup-python@v6
6060
name: Setup Python
6161
with:
6262
python-version: "3.9"
@@ -189,7 +189,7 @@ jobs:
189189
echo "Resolved source files: ${out}"
190190
fi
191191
192-
- uses: actions/checkout@v4
192+
- uses: actions/checkout@v6
193193
name: Checkout source repo glossary
194194
if: steps.source_files.outputs.has_source_changes == 'true'
195195
with:
@@ -262,7 +262,7 @@ jobs:
262262
263263
- name: Create PR
264264
if: steps.changes.outputs.has_changes == 'true'
265-
uses: peter-evans/create-pull-request@v7
265+
uses: peter-evans/create-pull-request@v8
266266
with:
267267
path: docs-cn
268268
token: ${{ github.token }}

0 commit comments

Comments
 (0)