1
0
mirror of synced 2026-01-03 15:05:54 -05:00
Files
docs/.github/workflows/crowdin-cleanup.yml
2022-05-19 19:12:18 +00:00

55 lines
1.8 KiB
YAML

name: Crowdin Cleanup
# **What it does**: Homogenizes localized non-translatable frontmatter after every push by the octoglot bot to the translations branch.
# **Why we have it**: So Crowdin doesn't break frontmatter in production.
# **Who does it impact**: Docs engineering and international expansion.
on:
workflow_dispatch:
push:
branches:
- translations
permissions:
contents: write
# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true
jobs:
homogenize_frontmatter:
name: Homogenize frontmatter
# Only run this after octoglot commits or when a Hubber is running this using the workflow dispatch button.
if: github.repository == 'github/docs-internal' && (github.event.pusher.name == 'octoglot' || github.event_name == 'workflow_dispatch')
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
- name: Setup Node
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561
with:
node-version: 16.15.x
cache: npm
- name: Install dependencies
run: npm ci
- name: Homogenize frontmatter
run: script/i18n/homogenize-frontmatter.js
- name: Check in homogenized files
uses: EndBug/add-and-commit@050a66787244b10a4874a2a5f682130263edc192
with:
# The arguments for the `git add` command
add: 'translations'
# The message for the commit
message: 'Run script/i18n/homogenize-frontmatter.js'
env:
# Disable pre-commit hooks; they don't play nicely with add-and-commit
HUSKY: '0'