Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 46 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out
<<<<<<< HEAD
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "18"
=======
uses: actions/checkout@v6
>>>>>>> 0f2e3b14b5 (ci: update actions (#22936))
- name: Verify duplicated file names
run: ./scripts/verify-duplicated-file-name.sh
- name: Verify internal links and anchors - tidb only
Expand All @@ -32,10 +36,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v4
- uses: actions/setup-node@v4
uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: "18"
<<<<<<< HEAD
- name: Check TOC-tidb-cloud.md existence
id: check_cloud_toc
uses: andstor/file-existence-action@v2
Expand All @@ -52,12 +57,50 @@ jobs:
cd ./tmp
./scripts/verify-links.sh
./scripts/verify-link-anchors.sh
=======
cache: npm
cache-dependency-path: package-lock.json
- name: Install Node dependencies
run: npm ci
- name: Verify internal links (full repo) - files
run: ./scripts/verify-links.sh

internal-links-anchors:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: "18"
cache: npm
cache-dependency-path: package-lock.json
- name: Install Node dependencies
run: npm ci
- name: Verify internal links (full repo) - anchors
run: ./scripts/verify-link-anchors.sh

internal-links-toc:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: "18"
cache: npm
cache-dependency-path: package-lock.json
- name: Install Node dependencies
run: npm ci
- name: Verify internal links (full repo) - TOC membership
run: node ./scripts/verify-internal-links-in-toc.js
>>>>>>> 0f2e3b14b5 (ci: update actions (#22936))

vale:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: Vale Linter
uses: errata-ai/vale-action@reviewdog
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/doc_review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
)
steps:
- name: Checkout Repo
uses: actions/checkout@v3
uses: actions/checkout@v6
with:
fetch-depth: 0 # Fetch all history for all branches and tags

Expand Down
14 changes: 13 additions & 1 deletion .github/workflows/ja-full-translation-google.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,30 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
name: Download translator repo
with:
<<<<<<< HEAD
repository: "shczhen/markdown-translator"
path: "markdown-translator"
- uses: actions/checkout@v4
=======
repository: "pingcap/docs-toolkit"
ref: "main"
path: "docs-toolkit"
- uses: actions/checkout@v6
>>>>>>> 0f2e3b14b5 (ci: update actions (#22936))
name: Download specified branch of docs repo
with:
ref: "release-7.5"
path: "docs"
<<<<<<< HEAD
- uses: actions/setup-node@v4
name: Setup node 18
=======
- uses: actions/setup-node@v6
name: Setup node
>>>>>>> 0f2e3b14b5 (ci: update actions (#22936))
with:
node-version: 18

Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/link.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,18 @@ jobs:

- name: Download Exclude Path
run: |
<<<<<<< HEAD
curl https://raw.githubusercontent.com/pingcap/docs/master/.lycheeignore --output .lycheeignore
=======
curl -fsSL https://raw.githubusercontent.com/pingcap/docs/master/.lycheeignore --output .lycheeignore

- name: Restore lychee cache
uses: actions/cache@v5
with:
path: .lycheecache
key: cache-lychee-${{ github.sha }}
restore-keys: cache-lychee-
>>>>>>> 0f2e3b14b5 (ci: update actions (#22936))

- name: Check Links
uses: lycheeverse/lychee-action@v1.6.1
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/media.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
name: Upload media files
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
# Must use at least depth 2!
fetch-depth: 2
Expand Down Expand Up @@ -60,10 +60,10 @@ jobs:
TENCENTCLOUD_SECRET_KEY: ${{ secrets.TENCENTCLOUD_SECRET_KEY }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Set up Python environment
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: "3.12"
architecture: "x64"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prevent-deletion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout base
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Fetch head
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rebase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout the latest code
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
token: ${{ secrets.REBASE_SECRET_KEY }}
fetch-depth: 0 # otherwise, you will fail to push refs to dest repo
Expand Down
120 changes: 120 additions & 0 deletions .github/workflows/sync-cloud-zh-toc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
name: Sync Cloud ZH TOC Files

on:
workflow_dispatch:

permissions:
contents: write
pull-requests: write

env:
EN_BRANCH: release-8.5
ZH_BRANCH: i18n-zh-release-8.5

jobs:
sync-toc:
if: github.repository == 'pingcap/docs'
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v6
name: Checkout ZH branch
with:
ref: "${{ env.ZH_BRANCH }}"
path: "docs"
token: ${{ github.token }}

- name: Copy script from main branch (temporary)
run: |
mkdir -p temp_scripts
curl -H "Authorization: Bearer ${{ github.token }}" \
-H "Accept: application/vnd.github.v3.raw" \
-L "https://api.github.com/repos/${{ github.repository }}/contents/scripts/sync-en-cloud-toc-changes-to-zh.py" \
-o temp_scripts/sync-en-cloud-toc-changes-to-zh.py

- uses: actions/setup-python@v6
name: Setup Python 3.11
with:
python-version: '3.11'

- name: Install Python dependencies
run: |
pip install "google-genai>=0.3,<1"

- name: Configure Git
run: |
cd docs
git config user.name github-actions
git config user.email github-actions@github.com

- name: Run TOC sync script
env:
GEMINI_API_TOKEN: ${{ secrets.GEMINI_API_TOKEN }}
GITHUB_TOKEN: ${{ github.token }}
run: |
cp temp_scripts/sync-en-cloud-toc-changes-to-zh.py docs/
cd docs
python sync-en-cloud-toc-changes-to-zh.py
rm sync-en-cloud-toc-changes-to-zh.py # Remove the script file so it won't be included in PR

- name: Clean up temporary files
run: |
rm -rf temp_scripts

- name: Check for changes
id: check_changes
run: |
cd docs
if git diff --quiet; then
echo "changes=false" >> $GITHUB_OUTPUT
echo "No changes detected"
else
echo "changes=true" >> $GITHUB_OUTPUT
echo "Changes detected"
fi

- name: Set build ID
id: build_id
if: steps.check_changes.outputs.changes == 'true'
run: echo "id=$(date +'%Y%m%d')-$(date +%s)" >> $GITHUB_OUTPUT

- name: Create PR
if: steps.check_changes.outputs.changes == 'true'
uses: peter-evans/create-pull-request@v8
with:
path: "docs"
token: ${{ github.token }}
branch: sync-zh-toc-${{ steps.build_id.outputs.id }}
base: ${{ env.ZH_BRANCH }}
title: "i18n-zh-release-8.5: sync ZH TOC changes ${{ steps.build_id.outputs.id }}"
body: |
### What is changed, added or deleted? (Required)

Sync Chinese Cloud TOC files based on English TOC updates from ${{ env.EN_BRANCH }} branch.

### Which TiDB version(s) do your changes apply to? (Required)

<!-- Fill in "x" in [] to tick the checkbox below.-->

**Tips for choosing the affected version(s):**

By default, **CHOOSE MASTER ONLY** so your changes will be applied to the next TiDB major or minor releases. If your PR involves a product feature behavior change or a compatibility change, **CHOOSE THE AFFECTED RELEASE BRANCH(ES) AND MASTER**.

For details, see [tips for choosing the affected versions](https://github.com/pingcap/docs/blob/master/CONTRIBUTING.md#guideline-for-choosing-the-affected-versions).

- [x] ${{ env.ZH_BRANCH }}

### What is the related PR or file link(s)?

<!--Reference link(s) will help reviewers review your PR quickly.-->

- This PR syncs TOC changes from: ${{ env.EN_BRANCH }}
- Other reference link(s):

### Do your changes match any of the following descriptions?

- [ ] Delete files
- [ ] Change aliases
- [ ] Need modification after applied to another branch <!-- If yes, please comment "/label version-specific-changes-required" below to trigger the bot to add the label. -->
- [ ] Might cause conflicts after applied to another branch
delete-branch: true
Loading
Loading