Skip to content

ci: verify docs update dates #71

ci: verify docs update dates

ci: verify docs update dates #71

Workflow file for this run

name: CI
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout main
uses: actions/checkout@v6
with:
ref: main
fetch-depth: 0
- name: Setup node
uses: actions/setup-node@v6
with:
node-version: '22.x'
- name: Build project
run: |
corepack enable
pnpm install --frozen-lockfile
pnpm build
- name: Verify docs update dates
run: |
expected_timestamp="$(git -C docs/tools log -1 --format=%ct -- vscode.md)"
expected_commit="$(git -C docs/tools log -1 --format='%H %s' -- vscode.md)"
actual_datetime="$(grep -o 'datetime="[^"]*"' build/docs/tools/vscode/index.html | head -n 1 | cut -d '"' -f 2)"
actual_timestamp="$(node -e 'console.log(Math.floor(new Date(process.argv[1]).getTime() / 1000))' "$actual_datetime")"
echo "Git history shallow: $(git rev-parse --is-shallow-repository)"
echo "Expected vscode.md last update: ${expected_timestamp} (${expected_commit})"
echo "Built vscode.md last update: ${actual_timestamp} (${actual_datetime})"
test "$actual_timestamp" = "$expected_timestamp"
- name: Upload COS
uses: zkqiang/tencent-cos-action@v0.1.0
with:
args: upload -rs --delete -y ./build/ /
secret_id: ${{ secrets.SECRET_ID }}
secret_key: ${{ secrets.SECRET_KEY }}
bucket: ${{ secrets.BUCKET }}
region: ap-shanghai