This commit is contained in:
Peter Bengtsson 2023-02-14 12:13:59 -05:00 коммит произвёл GitHub
Родитель c3483648a6
Коммит 7d7b0bffb8
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 15 добавлений и 60 удалений

67
.github/workflows/orphaned-assets-check.yml поставляемый
Просмотреть файл

@ -24,66 +24,13 @@ jobs:
# CI in the PR. (Events from GITHUB_TOKEN don't trigger new workflows.)
token: ${{ secrets.DOCUBOT_REPO_PAT }}
# TODO: Can be removed after we no longer keep translations in-repo
- name: Remove existing language translations
run: |
rm -rf translations
- name: Checkout the zh-cn repo
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
# It's important because translations are often a bit behind.
# So if a translation is a bit behind, it might still be referencing
# an asset even though none of the English content does.
- name: Clone all translations
uses: ./.github/actions/clone-translations
with:
repository: github/docs-internal.zh-cn
token: ${{ secrets.DOCUBOT_READORG_REPO_WORKFLOW_SCOPES }}
path: translations/zh-CN
- name: Checkout the ja-jp repo
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
with:
repository: github/docs-internal.ja-jp
token: ${{ secrets.DOCUBOT_READORG_REPO_WORKFLOW_SCOPES }}
path: translations/ja-JP
- name: Checkout the es-es repo
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
with:
repository: github/docs-internal.es-es
token: ${{ secrets.DOCUBOT_READORG_REPO_WORKFLOW_SCOPES }}
path: translations/es-ES
- name: Checkout the pt-br repo
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
with:
repository: github/docs-internal.pt-br
token: ${{ secrets.DOCUBOT_READORG_REPO_WORKFLOW_SCOPES }}
path: translations/pt-BR
- name: Checkout the de-de repo
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
with:
repository: github/docs-internal.de-de
token: ${{ secrets.DOCUBOT_READORG_REPO_WORKFLOW_SCOPES }}
path: translations/de-DE
- name: Checkout the fr-fr repo
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
with:
repository: github/docs-internal.fr-fr
token: ${{ secrets.DOCUBOT_READORG_REPO_WORKFLOW_SCOPES }}
path: translations/fr-FR
- name: Checkout the ru-ru repo
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
with:
repository: github/docs-internal.ru-ru
token: ${{ secrets.DOCUBOT_READORG_REPO_WORKFLOW_SCOPES }}
path: translations/ru-RU
- name: Checkout the ko-kr repo
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
with:
repository: github/docs-internal.ko-kr
token: ${{ secrets.DOCUBOT_READORG_REPO_WORKFLOW_SCOPES }}
path: translations/ko-KR
token: ${{ secrets.DOCUBOT_REPO_PAT }}
- uses: ./.github/actions/node-npm-setup
@ -96,6 +43,8 @@ jobs:
./script/find-orphaned-assets.js | xargs git rm
git status
# If nothing to commit, exit now. It's fine. No orphans.
git status -- ':!translations*' | grep 'nothing to commit' && exit 0

Просмотреть файл

@ -12,6 +12,8 @@ import path from 'path'
import { program } from 'commander'
import walk from 'walk-sync'
import languages from '../lib/languages.js'
const EXCEPTIONS = new Set([
'assets/images/site/favicon.ico',
'assets/images/site/apple-touch-icon.png',
@ -60,7 +62,11 @@ async function main(opts) {
'.github/actions-scripts',
]
if (!excludeTranslations) {
roots.push('translations')
for (const [language, { dir }] of Object.entries(languages)) {
if (language !== 'en') {
roots.push(dir)
}
}
}
for (const root of roots) {