summaryrefslogtreecommitdiff
path: root/.github/workflows/sync-readmes.yml
blob: b6ae84a6e16b44a02e9a935b0e32e0956b042376 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Sync translations and website

# README.md is the single source of truth for listed skills. Whenever it changes
# on main, regenerate the skill directory in every README.<lang>.md and the
# website's skills.json, and commit the result.
on:
  push:
    branches: [main]
    paths:
      - README.md
      - scripts/sync_translations.py
      - scripts/i18n.json
      - website/scripts/build-skills.mjs
  workflow_dispatch:

permissions:
  contents: write

concurrency:
  group: sync-readmes
  cancel-in-progress: false

jobs:
  sync:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - uses: actions/setup-node@v4
        with:
          node-version: 22

      - name: Regenerate translations and website data
        run: |
          python3 scripts/sync_translations.py
          node website/scripts/build-skills.mjs

      - name: Commit changes
        run: |
          if git diff --quiet; then
            echo "Everything already in sync."
            exit 0
          fi
          git config user.name "github-actions[bot]"
          git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
          git add README.*.md website/src/data/skills.json
          git commit -m "Sync translated READMEs and website skill data from README.md"
          git push