1
0
mirror of synced 2026-01-07 09:01:31 -05:00

Merge pull request #20470 from github/repo-sync

repo sync
This commit is contained in:
Octomerger Bot
2022-09-07 16:29:08 -04:00
committed by GitHub
6 changed files with 97 additions and 99 deletions

View File

@@ -107,14 +107,14 @@ async function findOrCreatePullRequest(config) {
* @param {object} config Configuration options for labeling the PR
* @returns {Promise<undefined>}
*/
async function labelPullRequest(config) {
await octokit.rest.issues.update({
owner: config.owner,
repo: config.repo,
issue_number: config.issue_number,
labels: config.labels,
})
}
// async function labelPullRequest(config) {
// await octokit.rest.issues.update({
// owner: config.owner,
// repo: config.repo,
// issue_number: config.issue_number,
// labels: config.labels,
// })
// }
async function main() {
const options = {
@@ -135,8 +135,8 @@ async function main() {
// metadata parameters aren't currently available in `github.rest.pulls.create`,
// but they are in `github.rest.issues.update`.
await labelPullRequest(options)
console.log(`Updated ${pr} with these labels: ${options.labels.join(', ')}`)
// await labelPullRequest(options)
// console.log(`Updated ${pr} with these labels: ${options.labels.join(', ')}`)
}
main()

View File

@@ -107,14 +107,14 @@ async function findOrCreatePullRequest(config) {
* @param {object} config Configuration options for labeling the PR
* @returns {Promise<undefined>}
*/
// async function labelPullRequest(config) {
// await octokit.rest.issues.update({
// owner: config.owner,
// repo: config.repo,
// issue_number: config.issue_number,
// labels: config.labels,
// })
// }
async function labelPullRequest(config) {
await octokit.rest.issues.update({
owner: config.owner,
repo: config.repo,
issue_number: config.issue_number,
labels: config.labels,
})
}
async function main() {
const options = {
@@ -135,8 +135,8 @@ async function main() {
// metadata parameters aren't currently available in `github.rest.pulls.create`,
// but they are in `github.rest.issues.update`.
// await labelPullRequest(options)
// console.log(`Updated ${pr} with these labels: ${options.labels.join(', ')}`)
await labelPullRequest(options)
console.log(`Updated ${pr} with these labels: ${options.labels.join(', ')}`)
}
main()

View File

@@ -10,8 +10,8 @@ name: Create translation Batch Pull Request
on:
workflow_dispatch:
schedule:
- cron: '02 17 * * *' # Once a day at 17:02 UTC / 9:02 PST
# schedule:
# - cron: '02 17 * * *' # Once a day at 17:02 UTC / 9:02 PST
permissions:
contents: write
@@ -172,11 +172,11 @@ jobs:
- name: Push filtered translations
run: git push origin ${{ steps.set-branch.outputs.BRANCH_NAME }}
- name: Close existing stale batches
uses: lee-dohm/close-matching-issues@e9e43aad2fa6f06a058cedfd8fb975fd93b56d8f
with:
token: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
query: 'type:pr label:translation-batch-${{ matrix.language }}'
# - name: Close existing stale batches
# uses: lee-dohm/close-matching-issues@e9e43aad2fa6f06a058cedfd8fb975fd93b56d8f
# with:
# token: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
# query: 'type:pr label:translation-batch-${{ matrix.language }}'
- name: Create translation batch pull request
env:
@@ -188,35 +188,35 @@ jobs:
BODY_FILE: '/tmp/pr-body.txt'
run: .github/actions-scripts/create-translation-batch-pr.js
- name: Approve PR
if: github.ref_name == 'main'
env:
GITHUB_TOKEN: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
run: gh pr review --approve || echo "Nothing to approve"
# - name: Approve PR
# if: github.ref_name == 'main'
# env:
# GITHUB_TOKEN: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
# run: gh pr review --approve || echo "Nothing to approve"
- name: Set auto-merge
if: github.ref_name == 'main'
env:
GITHUB_TOKEN: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
run: gh pr merge ${{ steps.set-branch.outputs.BRANCH_NAME }} --auto --squash || echo "Nothing to merge"
# - name: Set auto-merge
# if: github.ref_name == 'main'
# env:
# GITHUB_TOKEN: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
# run: gh pr merge ${{ steps.set-branch.outputs.BRANCH_NAME }} --auto --squash || echo "Nothing to merge"
# When the maximum execution time is reached for this job, Actions cancels the workflow run.
# This emits a notification for the first responder to triage.
- name: Send Slack notification if workflow is cancelled
uses: someimportantcompany/github-actions-slack-message@f8d28715e7b8a4717047d23f48c39827cacad340
if: cancelled()
with:
channel: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
bot-token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
color: failure
text: 'The new translation batch for ${{ matrix.language }} was cancelled.'
# # When the maximum execution time is reached for this job, Actions cancels the workflow run.
# # This emits a notification for the first responder to triage.
# - name: Send Slack notification if workflow is cancelled
# uses: someimportantcompany/github-actions-slack-message@f8d28715e7b8a4717047d23f48c39827cacad340
# if: cancelled()
# with:
# channel: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
# bot-token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
# color: failure
# text: 'The new translation batch for ${{ matrix.language }} was cancelled.'
# Emit a notification for the first responder to triage if the workflow failed.
- name: Send Slack notification if workflow failed
uses: someimportantcompany/github-actions-slack-message@f8d28715e7b8a4717047d23f48c39827cacad340
if: failure()
with:
channel: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
bot-token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
color: failure
text: 'The new translation batch for ${{ matrix.language }} failed.'
# # Emit a notification for the first responder to triage if the workflow failed.
# - name: Send Slack notification if workflow failed
# uses: someimportantcompany/github-actions-slack-message@f8d28715e7b8a4717047d23f48c39827cacad340
# if: failure()
# with:
# channel: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
# bot-token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
# color: failure
# text: 'The new translation batch for ${{ matrix.language }} failed.'

View File

@@ -10,9 +10,8 @@ name: Create translation Batch Pull Request (Microsoft)
on:
workflow_dispatch:
# TODO: bring schedule back in
# schedule:
# - cron: '02 17 * * *' # Once a day at 17:02 UTC / 9:02 PST
schedule:
- cron: '02 17 * * *' # Once a day at 17:02 UTC / 9:02 PST
permissions:
contents: write
@@ -145,14 +144,12 @@ jobs:
- name: Push filtered translations
run: git push origin ${{ steps.set-branch.outputs.BRANCH_NAME }}
# TODO: bring this step back
# - name: Close existing stale batches
# uses: lee-dohm/close-matching-issues@e9e43aad2fa6f06a058cedfd8fb975fd93b56d8f
# with:
# token: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
# query: 'type:pr label:translation-batch-${{ matrix.language }}'
- name: Close existing stale batches
uses: lee-dohm/close-matching-issues@e9e43aad2fa6f06a058cedfd8fb975fd93b56d8f
with:
token: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
query: 'type:pr label:translation-batch-${{ matrix.language }}'
# TODO: bring labels back into the PR script
- name: Create translation batch pull request
env:
GITHUB_TOKEN: ${{ secrets.DOCUBOT_REPO_PAT }}
@@ -163,36 +160,35 @@ jobs:
BODY_FILE: '/tmp/pr-body.txt'
run: .github/actions-scripts/msft-create-translation-batch-pr.js
# TODO: bring back these steps
# - name: Approve PR
# if: github.ref_name == 'main'
# env:
# GITHUB_TOKEN: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
# run: gh pr review --approve || echo "Nothing to approve"
- name: Approve PR
if: github.ref_name == 'main'
env:
GITHUB_TOKEN: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
run: gh pr review --approve || echo "Nothing to approve"
# - name: Set auto-merge
# if: github.ref_name == 'main'
# env:
# GITHUB_TOKEN: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
# run: gh pr merge ${{ steps.set-branch.outputs.BRANCH_NAME }} --auto --squash || echo "Nothing to merge"
- name: Set auto-merge
if: github.ref_name == 'main'
env:
GITHUB_TOKEN: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
run: gh pr merge ${{ steps.set-branch.outputs.BRANCH_NAME }} --auto --squash || echo "Nothing to merge"
# # When the maximum execution time is reached for this job, Actions cancels the workflow run.
# # This emits a notification for the first responder to triage.
# - name: Send Slack notification if workflow is cancelled
# uses: someimportantcompany/github-actions-slack-message@f8d28715e7b8a4717047d23f48c39827cacad340
# if: cancelled()
# with:
# channel: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
# bot-token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
# color: failure
# text: 'The new translation batch for ${{ matrix.language }} was cancelled.'
# When the maximum execution time is reached for this job, Actions cancels the workflow run.
# This emits a notification for the first responder to triage.
- name: Send Slack notification if workflow is cancelled
uses: someimportantcompany/github-actions-slack-message@f8d28715e7b8a4717047d23f48c39827cacad340
if: cancelled()
with:
channel: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
bot-token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}🎉
color: failure
text: 'The new translation batch for ${{ matrix.language }} was cancelled.'
# # Emit a notification for the first responder to triage if the workflow failed.
# - name: Send Slack notification if workflow failed
# uses: someimportantcompany/github-actions-slack-message@f8d28715e7b8a4717047d23f48c39827cacad340
# if: failure()
# with:
# channel: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
# bot-token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
# color: failure
# text: 'The new translation batch for ${{ matrix.language }} failed.'
# Emit a notification for the first responder to triage if the workflow failed.
- name: Send Slack notification if workflow failed
uses: someimportantcompany/github-actions-slack-message@f8d28715e7b8a4717047d23f48c39827cacad340
if: failure()
with:
channel: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
bot-token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
color: failure
text: 'The new translation batch for ${{ matrix.language }} failed.'

View File

@@ -23,7 +23,7 @@ const langWalksTable = nonEnglish.map(([code, lang]) => [
lang,
new Set(walk(`${lang.dir}/content`, {
directories: false,
ignore: ['**/README.md'],
ignore: ['**/README.md', 'search'],
}))
])

View File

@@ -34,7 +34,8 @@ describe('frame', () => {
expect($('html').attr('lang')).toBe(lang)
})
test.each(langs)('autogenerated heading IDs on %s are in english', async (lang) => {
// Docs Engineering issue: 2096
test.skip.each(langs)('autogenerated heading IDs on %s are in english', async (lang) => {
const $ = await getDOM(`/${lang}/site-policy/github-terms/github-terms-of-service`)
expect($('h2 a[href="#summary"]').length).toBe(1)
})
@@ -49,7 +50,8 @@ describe('frame', () => {
)
})
test.each(langs)('loads the survey via site data in %s', async (lang) => {
// Docs Engineering issue: 2166
test.skip.each(langs)('loads the survey via site data in %s', async (lang) => {
const $en = await getDOM(`/en`)
const $ = await getDOM(`/${lang}`)
expect(