Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save electrocucaracha/5b274f735adb3465a26673d6c75f578f to your computer and use it in GitHub Desktop.
Save electrocucaracha/5b274f735adb3465a26673d6c75f578f to your computer and use it in GitHub Desktop.
Create GitHub Issue in kubernetes/website repo using GitHub API for Spanish localizations
// https://docs.github.com/en/rest/issues/issues?apiVersion=2022-11-28#create-an-issue
import { Octokit } from "octokit";
const GITHUB_TOKEN = process.env.GITHUB_TOKEN
const octokit = new Octokit({
auth: GITHUB_TOKEN
});
// const file_to_be_translated = "content/en/docs/concepts/architecture/cri.md"
const file_to_be_translated = "content/en/docs/" + process.argv[2]
const title = `[es] localize ${file_to_be_translated} to Spanish`
await octokit.request('POST /repos/kubernetes/website/issues', {
owner: 'kubernetes',
repo: 'website',
title,
body: `
**This is a Feature Request**
**What would you like to be added**
Localize \`${file_to_be_translated}\` to Spanish
**Why is this needed**
There is no Spanish localization for this file.
**Comments**
/triage accepted
/kind feature
/language es
/sig docs
`,
assignees: [],
labels: [],
headers: {
'X-GitHub-Api-Version': '2022-11-28'
}
})
{"type": "module"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment