Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into update_3rd_party_…
Browse files Browse the repository at this point in the history
…sw_version
  • Loading branch information
qiancai committed Oct 27, 2022
2 parents 3ef8691 + dee6001 commit 3fbfce5
Show file tree
Hide file tree
Showing 405 changed files with 18,708 additions and 5,186 deletions.
3 changes: 2 additions & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ By default, **CHOOSE MASTER ONLY** so your changes will be applied to the next T
For details, see [tips for choosing the affected versions](https://github.com/pingcap/docs/blob/master/CONTRIBUTING.md#guideline-for-choosing-the-affected-versions).

- [ ] master (the latest development version)
- [ ] v6.2 (TiDB 6.2 versions)
- [ ] v6.4 (TiDB 6.4 versions)
- [ ] v6.3 (TiDB 6.3 versions)
- [ ] v6.1 (TiDB 6.1 versions)
- [ ] v5.4 (TiDB 5.4 versions)
- [ ] v5.3 (TiDB 5.3 versions)
Expand Down
13 changes: 3 additions & 10 deletions .github/workflows/dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ name: Trigger docs site update

on:
push:
paths-ignore:
- ".github/**"
branches:
# - master
- master
- release-*
- i18n-ja-release-5.4

jobs:
trigger:
Expand All @@ -18,14 +19,6 @@ jobs:
run: |
echo "::set-output name=sha::$(sha=${{ github.sha }}; echo ${sha:0:6})"
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.PR_TRIGGER_BUILD_TOKEN }}
repository: pingcap/website-docs
event-type: ${{ github.repository }}/${{ github.ref_name }}-${{ steps.extract.outputs.sha }}
client-payload: '{ "repo": "${{ github.repository }}", "ref": "${{ github.ref_name }}", "sha": "${{ github.sha }}" }'

- name: trigger docs-staging workflow
run: |
curl \
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/link-fail-fast.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Links (Fail Fast)

on:
pull_request:

jobs:
linkChecker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2

- name: 'Get a list of changed markdown files to process'
id: changed-files
run: |
CHANGED_FILES=$(git diff-tree --name-only --diff-filter 'AM' -r HEAD^1 HEAD -- "*.md" | sed -z "s/\n$//;s/\n/' '/g")
echo "::set-output name=all_changed_files::${CHANGED_FILES}"
- name: Download Exclude Path
run: |
curl https://raw.githubusercontent.com/pingcap/docs/master/.lycheeignore -O
- name: Link Checker
if: ${{ steps.changed-files.outputs.all_changed_files }}
uses: lycheeverse/lychee-action@v1.5.0
with:
fail: true
args: -E --exclude-mail -i -n -t 45 -- '${{ steps.changed-files.outputs.all_changed_files }}'
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
4 changes: 3 additions & 1 deletion .github/workflows/link.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ jobs:
uses: lycheeverse/lychee-action@v1.5.0
with:
# For parameter description, see https://github.com/lycheeverse/lychee#commandline-parameters
args: -E --exclude-mail -v -i -n -t 45 -- **/*.md
# Accept 429 for now due to github rate limit.
# See https://github.com/lycheeverse/lychee/issues/634
args: -E --exclude-mail -i -n -t 45 -- **/*.md *.md
output: out.md
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/prevent-deletion.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Prevent Deletion

on:
pull_request_target:
types: [opened, reopened, synchronize]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true

jobs:
check:
permissions:
checks: write
runs-on: ubuntu-latest
steps:
- name: Checkout base
uses: actions/checkout@v3
- name: Fetch head
run: |
git remote add head ${{ github.event.pull_request.head.repo.clone_url }}
git fetch --depth=1 head ${{ github.event.pull_request.head.ref }}
- name: Find changes
run: |
git rev-parse '${{ github.event.pull_request.head.sha }}'
if git diff --name-only --diff-filter 'D' HEAD '${{ github.event.pull_request.head.sha }}' | grep -E '^media/.*\.(jpg|png|jpeg|gif)$' >/tmp/changed_files; then
cat /tmp/changed_files
echo '{"name":"Image Deletion Check","head_sha":"${{ github.event.pull_request.head.sha }}","status":"completed","conclusion":"failure"}' > /tmp/body.json
jq \
--arg count "$(wc -l /tmp/changed_files | awk '{print $1}')" \
--arg summary "$(cat /tmp/changed_files | sed 's/^/- /')" \
'.output.title = "Found " + $count + " deleted images" | .output.summary = $summary' \
/tmp/body.json > /tmp/body2.json
else
echo '{"name":"Image Deletion Check","head_sha":"${{ github.event.pull_request.head.sha }}","status":"completed","conclusion":"success","output":{"title":"OK","summary":"No deleted images"}}' > /tmp/body2.json
fi
- name: Publish result
run: |
cat /tmp/body2.json
curl \
-sSL \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token ${{ github.token }}" \
-T '/tmp/body2.json' \
'https://api.github.com/repos/${{ github.repository }}/check-runs'
4 changes: 3 additions & 1 deletion .lycheeignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ http://grafana_ip:3000.*
http://\$?\{remote-server-ip}:3000.*
file:///home/runner/work/(docs|docs-cn)/(docs|docs-cn)/develop/.*
file://.*https:/%7BnodeIP%7D:%7BnodePort%7D/dashboard
file://.*?http:/\$%7BPD_IP%7D:\$%7BPD_PORT%7D/dashboard.*
file://.*?http:/\$%7BPD_IP%7D:\$%7BPD_PORT%7D/dashboard.*
http://\{grafana-ip\}:3000
http://\{pd-ip\}:2379/dashboard
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ Currently, we maintain the following versions of TiDB documentation in different
| Branch name | TiDB docs version |
| :---------|:----------|
| [`master`](https://github.com/pingcap/docs/tree/master) | The latest development version |
| [`release-6.3`](https://github.com/pingcap/docs/tree/release-6.3) | 6.3 Development Milestone Release |
| [`release-6.2`](https://github.com/pingcap/docs/tree/release-6.2) | 6.2 Development Milestone Release |
| [`release-6.1`](https://github.com/pingcap/docs/tree/release-6.1) | 6.1 LTS (Long-Term Support) version |
| [`release-6.0`](https://github.com/pingcap/docs/tree/release-6.0) | 6.0 Development Milestone Release |
| [`release-5.4`](https://github.com/pingcap/docs/tree/release-5.4) | 5.4 stable version |
Expand Down
Loading

0 comments on commit 3fbfce5

Please sign in to comment.