Skip to content

Commit 3de8d7a

Browse files
authored
Merge pull request github#6412 from github/repo-sync
repo sync
2 parents 97965ec + fc9a0d5 commit 3de8d7a

File tree

4 files changed

+37
-4
lines changed

4 files changed

+37
-4
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Crowdin Cleanup
2+
3+
# **What it does**: Homogenizes localized non-translatable frontmatter after every push by the octoglot bot to the translations branch.
4+
# **Why we have it**: So Crowdin doesn't break frontmatter in production.
5+
# **Who does it impact**: Docs engineering and international expansion.
6+
7+
on:
8+
workflow_dispatch:
9+
push:
10+
branches:
11+
- translations
12+
13+
jobs:
14+
homogenize_frontmatter:
15+
name: Homogenize frontmatter
16+
# Only run this after octoglot commits or when a Hubber is running this using the workflow dispatch button.
17+
if: github.repository == 'github/docs-internal' && (github.event.pusher.name == 'octoglot' || github.event_name == 'workflow_dispatch')
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
22+
23+
- name: Homogenize frontmatter
24+
run: script/i18n/homogenize-frontmatter.js
25+
26+
- name: Check in homogenized files
27+
uses: EndBug/add-and-commit@b3c7c1e078a023d75fb0bd326e02962575ce0519
28+
with:
29+
# The arguments for the `git add` command
30+
add: 'translations'
31+
32+
# The message for the commit
33+
message: 'Run script/i18n/homogenize-frontmatter.js'
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{% data variables.product.prodname_codeql %} also runs a build for Go projects to set up the project. However, in contrast to the other compiled languages, all Go files in the repository are extracted, not just those that are built. Custom build commands are not supported for Go.
1+
{% data variables.product.prodname_codeql %} also runs a build for Go projects to set up the project. However, in contrast to the other compiled languages, all Go files in the repository are extracted, not just those that are built. You can use custom build commands to skip extracting Go files that are not touched by the build.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
If the C/C++, C#, or Java code in your repository has a non-standard build process, `autobuild` may fail. You will need to remove the `autobuild` step from the workflow, and manually add build steps.
1+
If the C/C++, C#, or Java code in your repository has a non-standard build process, `autobuild` may fail. You will need to remove the `autobuild` step from the workflow, and manually add build steps. If you want to specify which Go files in your repository to extract, you will need to add build steps.

script/i18n/homogenize-frontmatter.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ async function main () {
5353

5454
// Look for differences between the english and localised non-translatable properties
5555
let overwroteSomething = false
56-
for (const prop in englishFrontmatter.data) {
57-
if (!fm.schema.properties[prop].translatable && localisedFrontmatter.data[prop] !== englishFrontmatter.data[prop]) {
56+
for (const prop in localisedFrontmatter.data) {
57+
if (!fm.schema.properties[prop].translatable && englishFrontmatter.data[prop] && localisedFrontmatter.data[prop] !== englishFrontmatter.data[prop]) {
5858
localisedFrontmatter.data[prop] = englishFrontmatter.data[prop]
5959
overwroteSomething = true
6060
}

0 commit comments

Comments
 (0)