Merge branch 'main' of github.com:github/docs-internal into hidden-docs-alt
This commit is contained in:
@@ -7,7 +7,7 @@ labels:
|
|||||||
assignees: ''
|
assignees: ''
|
||||||
---
|
---
|
||||||
<!--
|
<!--
|
||||||
HUBBERS BEWARE! THE GITHUB/DOCS REPO IS PUBLIC TO THE ENTIRE INTERNET. OPEN AN ISSUE IN GITHUB/DOCS-CONTENT https://github.com/github/docs-content/issues/new/choose INSTEAD.
|
HUBBERS BEWARE! THE GITHUB/DOCS REPO IS PUBLIC TO THE ENTIRE INTERNET. OPEN AN ISSUE IN GITHUB/DOCS-CONTENT INSTEAD.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
|
|||||||
2
.github/ISSUE_TEMPLATE/improve-the-site.md
vendored
2
.github/ISSUE_TEMPLATE/improve-the-site.md
vendored
@@ -7,7 +7,7 @@ assignees: ''
|
|||||||
---
|
---
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
HUBBERS BEWARE! THE GITHUB/DOCS REPO IS PUBLIC TO THE ENTIRE INTERNET. OPEN AN ISSUE IN GITHUB/DOCS-CONTENT https://github.com/github/docs-content/issues/new/choose INSTEAD.
|
HUBBERS BEWARE! THE GITHUB/DOCS REPO IS PUBLIC TO THE ENTIRE INTERNET. OPEN AN ISSUE IN GITHUB/DOCS-CONTENT INSTEAD.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
|
|||||||
39
.github/workflows/close-unwanted-pull-requests.yml
vendored
Normal file
39
.github/workflows/close-unwanted-pull-requests.yml
vendored
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
name: Close unwanted pull requests
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- '.github/workflows/**'
|
||||||
|
- '.github/CODEOWNERS'
|
||||||
|
- 'translations/**'
|
||||||
|
- 'assets/fonts/**'
|
||||||
|
- 'data/graphql/**'
|
||||||
|
- 'lib/graphql/**'
|
||||||
|
- 'lib/redirects/**'
|
||||||
|
- 'lib/webhooks/**'
|
||||||
|
jobs:
|
||||||
|
close_unwanted_pull_requests:
|
||||||
|
if: github.repository == 'github/docs'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
await github.issues.createComment({
|
||||||
|
...context.repo,
|
||||||
|
issue_number: context.payload.pull_request.number,
|
||||||
|
body:
|
||||||
|
`Thanks for contributing! We do not accept community changes to these files at this time.
|
||||||
|
- '.github/workflows/**'
|
||||||
|
- '.github/CODEOWNERS'
|
||||||
|
- 'translations/**'
|
||||||
|
- 'assets/fonts/**'
|
||||||
|
- 'data/graphql/**'
|
||||||
|
- 'lib/graphql/**'
|
||||||
|
- 'lib/redirects/**'
|
||||||
|
- 'lib/webhooks/**'`
|
||||||
|
})
|
||||||
|
await github.issues.update({
|
||||||
|
...context.repo,
|
||||||
|
issue_number: context.payload.pull_request.number,
|
||||||
|
state: 'closed'
|
||||||
|
})
|
||||||
@@ -37,4 +37,4 @@ jobs:
|
|||||||
if: failure()
|
if: failure()
|
||||||
env:
|
env:
|
||||||
SLACK_WEBHOOK: ${{ secrets.DOCS_ALERTS_SLACK_WEBHOOK }}
|
SLACK_WEBHOOK: ${{ secrets.DOCS_ALERTS_SLACK_WEBHOOK }}
|
||||||
SLACK_MESSAGE: The last Algolia workflow run for ${{github.repository}} failed. See https://github.com/github/docs-internal/actions?query=workflow%3AAlgolia
|
SLACK_MESSAGE: The last Algolia workflow run for ${{github.repository}} failed. Search actions for `workflow:Algolia`
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
## Importing Aftermarket Octicons
|
|
||||||
|
|
||||||
#### Background
|
|
||||||
Some octicons are missing from the project's current version of the `octicons` gem. Because this project is being replaced soon and updating `octicons` would require [significant changes](https://github.com/github/docs-internal/issues/6250#issuecomment-339730405), new octicons should be added manually as needed, via the following process:
|
|
||||||
|
|
||||||
#### How to add
|
|
||||||
|
|
||||||
1. Locate the missing octicon `.svg` in [primer/octions](https://github.com/primer/octicons/tree/master/lib/svg) and download it to your local `app/assets/images/octions` folder
|
|
||||||
1. Add a line to `app/assets/stylesheets/shared/_octicons.scss` for the new octicon, like so:
|
|
||||||
```apple css
|
|
||||||
.octicon-<YOUR OCTICON NAME>:before {
|
|
||||||
content: url("#{$new-octicons-path}/<YOUR OCTICON FILENAME>.svg")
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
You may now use the new octicon in your content as normal! :tada:
|
|
||||||
@@ -46,16 +46,16 @@ typing `git remote -v`:
|
|||||||
```shell
|
```shell
|
||||||
$ git remote -v
|
$ git remote -v
|
||||||
# View existing remotes
|
# View existing remotes
|
||||||
> origin https://github.com/github/reactivecocoa.git (fetch)
|
> origin https://github.com/ghost/reactivecocoa.git (fetch)
|
||||||
> origin https://github.com/github/reactivecocoa.git (push)
|
> origin https://github.com/ghost/reactivecocoa.git (push)
|
||||||
|
|
||||||
$ git remote set-url origin https://github.com/github/ReactiveCocoa.git
|
$ git remote set-url origin https://github.com/ghost/ReactiveCocoa.git
|
||||||
# Change the 'origin' remote's URL
|
# Change the 'origin' remote's URL
|
||||||
|
|
||||||
$ git remote -v
|
$ git remote -v
|
||||||
# Verify new remote URL
|
# Verify new remote URL
|
||||||
> origin https://github.com/github/ReactiveCocoa.git (fetch)
|
> origin https://github.com/ghost/ReactiveCocoa.git (fetch)
|
||||||
> origin https://github.com/github/ReactiveCocoa.git (push)
|
> origin https://github.com/ghost/ReactiveCocoa.git (push)
|
||||||
```
|
```
|
||||||
|
|
||||||
Alternatively, you can change the URL through our
|
Alternatively, you can change the URL through our
|
||||||
|
|||||||
@@ -298,7 +298,7 @@ You can quickly analyze small portions of a monorepo when you modify code in spe
|
|||||||
|
|
||||||
If your workflow for {% data variables.product.prodname_code_scanning %} accesses a private repository, other than the repository that contains the workflow, you'll need to configure Git to authenticate with a personal access token. Define the secret in the runner environment by using `jobs.<job_id>.steps.env` in your workflow before any {% data variables.product.prodname_codeql %} actions. For more information, see "[Creating a personal access token for the command line](/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line)" and "[Creating and storing encrypted secrets](/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets)."
|
If your workflow for {% data variables.product.prodname_code_scanning %} accesses a private repository, other than the repository that contains the workflow, you'll need to configure Git to authenticate with a personal access token. Define the secret in the runner environment by using `jobs.<job_id>.steps.env` in your workflow before any {% data variables.product.prodname_codeql %} actions. For more information, see "[Creating a personal access token for the command line](/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line)" and "[Creating and storing encrypted secrets](/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets)."
|
||||||
|
|
||||||
For example, the following configuration has Git replace the full URLs to the `github/foo`, `github/bar`, and `github/baz` repositories on {% data variables.product.prodname_dotcom_the_website %} with URLs that include the personal access token that you store in the `ACCESS_TOKEN` environment variable.
|
For example, the following configuration has Git replace the full URLs to the `ghost/foo`, `ghost/bar`, and `ghost/baz` repositories on {% data variables.product.prodname_dotcom_the_website %} with URLs that include the personal access token that you store in the `ACCESS_TOKEN` environment variable.
|
||||||
|
|
||||||
{% raw %}
|
{% raw %}
|
||||||
```yaml
|
```yaml
|
||||||
@@ -307,9 +307,9 @@ steps:
|
|||||||
env:
|
env:
|
||||||
TOKEN: ${{ secrets.ACCESS_TOKEN }}
|
TOKEN: ${{ secrets.ACCESS_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
git config --global url."https://${TOKEN}@github.com/github/foo".insteadOf "https://github.com/github/foo"
|
git config --global url."https://${TOKEN}@github.com/ghost/foo".insteadOf "https://github.com/ghost/foo"
|
||||||
git config --global url."https://${TOKEN}@github.com/github/bar".insteadOf "https://github.com/github/bar"
|
git config --global url."https://${TOKEN}@github.com/ghost/bar".insteadOf "https://github.com/ghost/bar"
|
||||||
git config --global url."https://${TOKEN}@github.com/github/baz".insteadOf "https://github.com/github/baz"
|
git config --global url."https://${TOKEN}@github.com/ghost/baz".insteadOf "https://github.com/ghost/baz"
|
||||||
```
|
```
|
||||||
{% endraw %}
|
{% endraw %}
|
||||||
|
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ A location within a programming artifact, such as a file in the repository or a
|
|||||||
|
|
||||||
| Name | Description |
|
| Name | Description |
|
||||||
|----|----|
|
|----|----|
|
||||||
| `artifactLocation.uri`| **Required.** A URI indicating the location of an artifact, usually a file either in the repository or generated during a build. If the URI is relative, it should be relative to the root of the {% data variables.product.prodname_dotcom %} repository being analyzed. For example, main.js or src/script.js are relative to the root of the repository. If the URI is absolute, {% data variables.product.prodname_code_scanning %} can use the URI to checkout the artifact and match up files in the repository. For example, `https://github.com/github/example/blob/00/src/promiseUtils.js`.
|
| `artifactLocation.uri`| **Required.** A URI indicating the location of an artifact, usually a file either in the repository or generated during a build. If the URI is relative, it should be relative to the root of the {% data variables.product.prodname_dotcom %} repository being analyzed. For example, main.js or src/script.js are relative to the root of the repository. If the URI is absolute, {% data variables.product.prodname_code_scanning %} can use the URI to checkout the artifact and match up files in the repository. For example, `https://github.com/ghost/example/blob/00/src/promiseUtils.js`.
|
||||||
| `region.startLine` | **Required.** The line number of the first character in the region.
|
| `region.startLine` | **Required.** The line number of the first character in the region.
|
||||||
| `region.startColumn` | **Required.** The column number of the first character in the region.
|
| `region.startColumn` | **Required.** The column number of the first character in the region.
|
||||||
| `region.endLine` | **Required.** The line number of the last character in the region.
|
| `region.endLine` | **Required.** The line number of the last character in the region.
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ If you want to explore repositories about a certain topic, find projects to cont
|
|||||||
|
|
||||||
The `is:featured` search qualifier will narrow search results to the topics with the most repositories on {% data variables.product.product_name %}. These topics are also featured at https://github.com/topics/.
|
The `is:featured` search qualifier will narrow search results to the topics with the most repositories on {% data variables.product.product_name %}. These topics are also featured at https://github.com/topics/.
|
||||||
|
|
||||||
The `is:curated` search qualifier will narrow search results to topics that community members have added extra information to. For more information, see the explore repository at https://github.com/github/explore.
|
The `is:curated` search qualifier will narrow search results to topics that community members have added extra information to. For more information, see the [explore repository](https://github.com/github/explore).
|
||||||
|
|
||||||
You can filter topics based when they were created using the date parameter and `created:` or based on how many repositories are associated with this topic using `repositories:n`. Both of these qualifiers can use the [greater than and less than range qualifiers](/articles/understanding-the-search-syntax).
|
You can filter topics based when they were created using the date parameter and `created:` or based on how many repositories are associated with this topic using `repositories:n`. Both of these qualifiers can use the [greater than and less than range qualifiers](/articles/understanding-the-search-syntax).
|
||||||
|
|
||||||
|
|||||||
@@ -5,14 +5,14 @@ by [automation](../script/graphql/README.md). These files **should not** be edit
|
|||||||
|
|
||||||
Dotcom source files:
|
Dotcom source files:
|
||||||
```
|
```
|
||||||
https://github.com/github/github/tree/master/config/schema.docs.graphql
|
config/schema.docs.graphql
|
||||||
https://github.com/github/github/tree/master/config/graphql_previews.yml
|
config/graphql_previews.yml
|
||||||
https://github.com/github/github/tree/master/config/graphql_upcoming_changes.yml
|
graphql_upcoming_changes.yml
|
||||||
```
|
```
|
||||||
|
|
||||||
Enterprise source files:
|
Enterprise source files:
|
||||||
```
|
```
|
||||||
https://github.com/github/github/tree/enterprise-VERSION-release/config/schema.docs-enterprise.graphql
|
enterprise-VERSION-release/config/schema.docs-enterprise.graphql
|
||||||
https://github.com/github/github/tree/enterprise-VERSION-release/config/graphql_previews.enterprise.yml
|
enterprise-VERSION-release/config/graphql_previews.enterprise.yml
|
||||||
https://github.com/github/github/tree/enterprise-VERSION-release/config/graphql_upcoming_changes.public-enterprise.yml
|
enterprise-VERSION-release/config/graphql_upcoming_changes.public-enterprise.yml
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
1. From the application server, navigate to the latest release of {% data variables.product.prodname_insights %} on the [Releases page](https://github.com/github/insights-releases/releases/latest) for `github/insights-releases`.
|
1. From the application server, navigate to the latest release of {% data variables.product.prodname_insights %} on the Releases page for `github/insights-releases`.
|
||||||
2. To download the latest release, under "Assets", click `insights-VERSION.tar.gz`.
|
2. To download the latest release, under "Assets", click `insights-VERSION.tar.gz`.
|
||||||

|

|
||||||
3. Unzip the directory.
|
3. Unzip the directory.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Use this variable wherever backticks are necessary: https://github.com/github/docs-internal/pull/1176#discussion-diff-19853931
|
# Use this variable wherever backticks are necessary
|
||||||
backticks: >-
|
backticks: >-
|
||||||
{% if currentVersion == "free-pro-team@latest" %}github.com{% else %}[hostname]{% endif %}
|
{% if currentVersion == "free-pro-team@latest" %}github.com{% else %}[hostname]{% endif %}
|
||||||
|
|
||||||
|
|||||||
@@ -2,5 +2,4 @@
|
|||||||
export default function () {
|
export default function () {
|
||||||
// TODO support "Run in Explorer" links in GraphQL guides
|
// TODO support "Run in Explorer" links in GraphQL guides
|
||||||
// will need to handle query params separately from search queries
|
// will need to handle query params separately from search queries
|
||||||
// see JS block at https://github.com/github/internal-developer.github.com/blob/master/assets/javascripts/documentation.js#L230
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ const s3ConfigPath = path.join(homedir, '.s3cfg')
|
|||||||
|
|
||||||
// check for config files
|
// check for config files
|
||||||
if (!(fs.existsSync(awsCredsPath) || fs.existsSync(s3ConfigPath))) {
|
if (!(fs.existsSync(awsCredsPath) || fs.existsSync(s3ConfigPath))) {
|
||||||
console.error('You need to set up awssume and s3cmd. Follow the steps at https://github.com/github/product-documentation/blob/master/doc-team-workflows/workflow-information-for-all-writers/setting-up-awssume-and-s3cmd.md')
|
console.error('You need to set up awssume and s3cmd. Follow the steps at docs-content/doc-team-workflows/workflow-information-for-all-writers/setting-up-awssume-and-s3cmd.md')
|
||||||
process.exit(1)
|
process.exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
const versionSatisfiesRange = require('./version-satisfies-range')
|
const versionSatisfiesRange = require('./version-satisfies-range')
|
||||||
|
|
||||||
// GHES Release Lifecycle Dates:
|
// GHES Release Lifecycle Dates:
|
||||||
// https://github.com/github/enterprise-releases/blob/master/docs/supported-versions.md#release-lifecycle-dates
|
// enterprise-releases/docs/supported-versions.md#release-lifecycle-dates
|
||||||
const dates = require('../lib/enterprise-dates.json')
|
const dates = require('../lib/enterprise-dates.json')
|
||||||
|
|
||||||
const supported = [
|
const supported = [
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ function frontmatter (markdown, opts = {}) {
|
|||||||
const defaults = {
|
const defaults = {
|
||||||
schema,
|
schema,
|
||||||
validateKeyNames: true,
|
validateKeyNames: true,
|
||||||
validateKeyOrder: false // TODO: enable this once we've sorted all the keys. See https://github.com/github/docs-internal/issues/9658
|
validateKeyOrder: false // TODO: enable this once we've sorted all the keys. See issue 9658
|
||||||
}
|
}
|
||||||
|
|
||||||
return parse(markdown, Object.assign({}, defaults, opts))
|
return parse(markdown, Object.assign({}, defaults, opts))
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ class Page {
|
|||||||
this.fullPath = slash(path.join(this.basePath, this.relativePath))
|
this.fullPath = slash(path.join(this.basePath, this.relativePath))
|
||||||
this.raw = fs.readFileSync(this.fullPath, 'utf8')
|
this.raw = fs.readFileSync(this.fullPath, 'utf8')
|
||||||
|
|
||||||
// TODO remove this when https://github.com/github/crowdin-support/issues/66 has been resolved
|
// TODO remove this when crowdin-support issue 66 has been resolved
|
||||||
if (this.languageCode !== 'en' && this.raw.includes(': verdadero')) {
|
if (this.languageCode !== 'en' && this.raw.includes(': verdadero')) {
|
||||||
this.raw = this.raw.replace(': verdadero', ': true')
|
this.raw = this.raw.replace(': verdadero', ': true')
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ const got = require('got')
|
|||||||
|
|
||||||
// This module handles requests for the CSS and JS assets for
|
// This module handles requests for the CSS and JS assets for
|
||||||
// deprecated GitHub Enterprise versions by routing them to static content in
|
// deprecated GitHub Enterprise versions by routing them to static content in
|
||||||
// https://github.com/github/help-docs-archived-enterprise-versions
|
// help-docs-archived-enterprise-versions
|
||||||
//
|
//
|
||||||
// See also ./archived-enterprise-versions.js for non-CSS/JS paths
|
// See also ./archived-enterprise-versions.js for non-CSS/JS paths
|
||||||
|
|
||||||
|
|||||||
@@ -8,8 +8,7 @@ const got = require('got')
|
|||||||
const findPage = require('../lib/find-page')
|
const findPage = require('../lib/find-page')
|
||||||
|
|
||||||
// This module handles requests for deprecated GitHub Enterprise versions
|
// This module handles requests for deprecated GitHub Enterprise versions
|
||||||
// by routing them to static content in
|
// by routing them to static content in help-docs-archived-enterprise-versions
|
||||||
// https://github.com/github/help-docs-archived-enterprise-versions
|
|
||||||
|
|
||||||
module.exports = async (req, res, next) => {
|
module.exports = async (req, res, next) => {
|
||||||
const { isArchived, requestedVersion } = isArchivedVersion(req)
|
const { isArchived, requestedVersion } = isArchivedVersion(req)
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ ownership:
|
|||||||
team: github/docs-engineering
|
team: github/docs-engineering
|
||||||
maintainer: zeke
|
maintainer: zeke
|
||||||
exec_sponsor: danaiszuul
|
exec_sponsor: danaiszuul
|
||||||
product_manager: jwargo
|
product_manager: simpsoka
|
||||||
mention: github/docs-engineering
|
mention: github/docs-engineering
|
||||||
qos: critical
|
qos: critical
|
||||||
dependencies: []
|
dependencies: []
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ This script is run automatically when you run the server locally. It checks whet
|
|||||||
|
|
||||||
### [`check-s3-images.js`](check-s3-images.js)
|
### [`check-s3-images.js`](check-s3-images.js)
|
||||||
|
|
||||||
Run this script in your branch to check whether any images referenced in content are not in an expected S3 bucket. You will need to authenticate to S3 via `awssume` to use this script. Instructions for the one-time setup are [here](https://github.com/github/product-documentation/blob/master/doc-team-workflows/workflow-information-for-all-writers/setting-up-awssume-and-s3cmd.md).
|
Run this script in your branch to check whether any images referenced in content are not in an expected S3 bucket. You will need to authenticate to S3 via `awssume` to use this script.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -304,14 +304,14 @@ This script is run as a git precommit hook (installed by husky after npm install
|
|||||||
|
|
||||||
### [`purge-fastly`](purge-fastly)
|
### [`purge-fastly`](purge-fastly)
|
||||||
|
|
||||||
Run this script to manually purge the [Fastly cache](https://github.com/github/docs-internal#fastly-cdn). Note this script requires a `FASTLY_SERVICE_ID` and `FASTLY_TOKEN` in your `.env` file.
|
Run this script to manually purge the Fastly cache. Note this script requires a `FASTLY_SERVICE_ID` and `FASTLY_TOKEN` in your `.env` file.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
### [`purge-fastly-by-url.js`](purge-fastly-by-url.js)
|
### [`purge-fastly-by-url.js`](purge-fastly-by-url.js)
|
||||||
|
|
||||||
Run this script to manually purge the [Fastly cache](https://github.com/github/docs-internal#fastly-cdn) for all language variants of a single URL or for a batch of URLs in a file. This script does not require authentication.
|
Run this script to manually purge the Fastly cache for all language variants of a single URL or for a batch of URLs in a file. This script does not require authentication.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -362,11 +362,11 @@ Examples:
|
|||||||
|
|
||||||
reset a single translated file using a relative path: $ script/reset-translated-file.js translations/es-XL/content/actions/index.md
|
reset a single translated file using a relative path: $ script/reset-translated-file.js translations/es-XL/content/actions/index.md
|
||||||
|
|
||||||
reset a single translated file using a full path: $ script/reset-translated-file.js /Users/z/git/github/docs-internal/translations/es-XL/content/actions/index.md
|
reset a single translated file using a full path: $ script/reset-translated-file.js /Users/z/git/github/docs/translations/es-XL/content/actions/index.md
|
||||||
|
|
||||||
reset all language variants of a single English file (using a relative path): $ script/reset-translated-file.js content/actions/index.md $ script/reset-translated-file.js data/ui.yml
|
reset all language variants of a single English file (using a relative path): $ script/reset-translated-file.js content/actions/index.md $ script/reset-translated-file.js data/ui.yml
|
||||||
|
|
||||||
reset all language variants of a single English file (using a full path): $ script/reset-translated-file.js /Users/z/git/github/docs-internal/content/desktop/index.md $ script/reset-translated-file.js /Users/z/git/github/docs-internal/data/ui.yml
|
reset all language variants of a single English file (using a full path): $ script/reset-translated-file.js /Users/z/git/github/docs/content/desktop/index.md $ script/reset-translated-file.js /Users/z/git/github/docs/data/ui.yml
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -422,7 +422,7 @@ Starts the local development server with all of the available languages enabled.
|
|||||||
|
|
||||||
### [`standardize-frontmatter-order.js`](standardize-frontmatter-order.js)
|
### [`standardize-frontmatter-order.js`](standardize-frontmatter-order.js)
|
||||||
|
|
||||||
Run this script to standardize frontmatter fields in all content files, per the order decided in https://github.com/github/docs-internal/issues/9658#issuecomment-485536265.
|
Run this script to standardize frontmatter fields in all content files.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -443,7 +443,7 @@ List all the TODOs in our JavaScript files and stylesheets.
|
|||||||
|
|
||||||
### [`update-enterprise-dates.js`](update-enterprise-dates.js)
|
### [`update-enterprise-dates.js`](update-enterprise-dates.js)
|
||||||
|
|
||||||
Run this script during Enterprise releases and deprecations. It uses the GitHub API to get dates from [`enterprise-releases`](https://github.com/github/enterprise-releases/blob/master/releases.json) and updates `lib/enterprise-dates.json`. The help site uses this JSON to display dates at the top of some Enterprise versions.
|
Run this script during Enterprise releases and deprecations. It uses the GitHub API to get dates from `enterprise-releases` and updates `lib/enterprise-dates.json`. The help site uses this JSON to display dates at the top of some Enterprise versions.
|
||||||
|
|
||||||
This script requires that you have a GitHub Personal Access Token in a `.env` file. If you don't have a token, get one [here](https://github.com/settings/tokens/new?scopes=repo&description=docs-dev). If you don't have an `.env` file in your docs checkout, run this command in Terminal:
|
This script requires that you have a GitHub Personal Access Token in a `.env` file. If you don't have a token, get one [here](https://github.com/settings/tokens/new?scopes=repo&description=docs-dev). If you don't have an `.env` file in your docs checkout, run this command in Terminal:
|
||||||
|
|
||||||
@@ -465,7 +465,7 @@ This script crawls the script directory, hooks on special comment markers in eac
|
|||||||
|
|
||||||
### [`update-s3cmd-config.js`](update-s3cmd-config.js)
|
### [`update-s3cmd-config.js`](update-s3cmd-config.js)
|
||||||
|
|
||||||
This script is used by other scripts to update temporary AWS credentials and authenticate to S3. See docs at [Setting up awssume and S3cmd](https://github.com/github/product-documentation/tree/master/doc-team-workflows/workflow-information-for-all-writers/setting-up-awssume-and-s3cmd.md).
|
This script is used by other scripts to update temporary AWS credentials and authenticate to S3.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ const versionsToCheck = Object.keys(allVersions)
|
|||||||
//
|
//
|
||||||
// Run this script in your branch to check whether any images referenced in content are
|
// Run this script in your branch to check whether any images referenced in content are
|
||||||
// not in an expected S3 bucket. You will need to authenticate to S3 via `awssume` to use this script.
|
// not in an expected S3 bucket. You will need to authenticate to S3 via `awssume` to use this script.
|
||||||
// Instructions for the one-time setup are [here](https://github.com/github/product-documentation/blob/master/doc-team-workflows/workflow-information-for-all-writers/setting-up-awssume-and-s3cmd.md).
|
// Instructions for the one-time setup are at docs-content/doc-team-workflows/workflow-information-for-all-writers/setting-up-awssume-and-s3cmd.md
|
||||||
//
|
//
|
||||||
// [end-readme]
|
// [end-readme]
|
||||||
|
|
||||||
|
|||||||
@@ -180,7 +180,6 @@ async function createRedirectPages (permalinks, pages, finalDirectory) {
|
|||||||
console.log('done creating redirect files!\n')
|
console.log('done creating redirect files!\n')
|
||||||
}
|
}
|
||||||
|
|
||||||
// prior art: https://github.com/github/help-docs-archived-enterprise-versions/blob/master/2.12/user/leave-a-repo/index.html
|
|
||||||
// redirect html files already exist in <=2.12 because these versions were deprecated on the old static site
|
// redirect html files already exist in <=2.12 because these versions were deprecated on the old static site
|
||||||
function getRedirectHtml (newPath) {
|
function getRedirectHtml (newPath) {
|
||||||
return `<!DOCTYPE html>
|
return `<!DOCTYPE html>
|
||||||
|
|||||||
@@ -9,4 +9,4 @@ These scripts update the [static JSON files](../../lib/graphql/static) used to
|
|||||||
render GraphQL docs. See the [`lib/graphql/README`](../../lib/graphql/README.md)
|
render GraphQL docs. See the [`lib/graphql/README`](../../lib/graphql/README.md)
|
||||||
for more info.
|
for more info.
|
||||||
|
|
||||||
**Note**: The changelog script pulls content from [the internal-developer repo](https://github.com/github/internal-developer.github.com/tree/master/content/v4/changelog). It relies on [graphql-docs automation](https://github.com/github/graphql-docs/blob/master/lib/graphql_docs/update_internal_developer/change_log.rb) running daily to update the changelog files in internal-developer.
|
**Note**: The changelog script pulls content from the internal-developer repo. It relies on graphql-docs automation running daily to update the changelog files in internal-developer.
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ function cleanPreviewTitle (title) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Turn the given title into an HTML-ready anchor.
|
* Turn the given title into an HTML-ready anchor.
|
||||||
* (ported from https://github.com/github/graphql-docs/blob/master/lib/graphql_docs/update_internal_developer/change_log.rb#L281)
|
* (ported from graphql-docs/lib/graphql_docs/update_internal_developer/change_log.rb#L281)
|
||||||
* @param {string} [previewTitle]
|
* @param {string} [previewTitle]
|
||||||
* @return {string}
|
* @return {string}
|
||||||
*/
|
*/
|
||||||
@@ -155,7 +155,7 @@ function cleanMessagesFromChanges (changes) {
|
|||||||
* Split `changesToReport` into two parts,
|
* Split `changesToReport` into two parts,
|
||||||
* one for changes in the main schema,
|
* one for changes in the main schema,
|
||||||
* and another for changes that are under preview.
|
* and another for changes that are under preview.
|
||||||
* (Ported from https://github.com/github/graphql-docs/blob/7e6a5ccbf13cc7d875fee65527b25bc49e886b41/lib/graphql_docs/update_internal_developer/change_log.rb#L230)
|
* (Ported from /graphql-docs/lib/graphql_docs/update_internal_developer/change_log.rb#L230)
|
||||||
* @param {Array<object>} changesToReport
|
* @param {Array<object>} changesToReport
|
||||||
* @param {object} previews
|
* @param {object} previews
|
||||||
* @return {object}
|
* @return {object}
|
||||||
@@ -203,7 +203,7 @@ function segmentPreviewChanges (changesToReport, previews) {
|
|||||||
// Deprecations are covered by "upcoming changes."
|
// Deprecations are covered by "upcoming changes."
|
||||||
// By listing the changes explicitly here, we can make sure that,
|
// By listing the changes explicitly here, we can make sure that,
|
||||||
// if the library changes, we don't miss publishing anything that we mean to.
|
// if the library changes, we don't miss publishing anything that we mean to.
|
||||||
// This was originally ported from https://github.com/github/graphql-docs/blob/7e6a5ccbf13cc7d875fee65527b25bc49e886b41/lib/graphql_docs/update_internal_developer/change_log.rb#L35-L103
|
// This was originally ported from graphql-docs/lib/graphql_docs/update_internal_developer/change_log.rb#L35-L103
|
||||||
const CHANGES_TO_REPORT = [
|
const CHANGES_TO_REPORT = [
|
||||||
ChangeType.FieldArgumentDefaultChanged,
|
ChangeType.FieldArgumentDefaultChanged,
|
||||||
ChangeType.FieldArgumentTypeChanged,
|
ChangeType.FieldArgumentTypeChanged,
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ if ARGV.empty?
|
|||||||
exit 1
|
exit 1
|
||||||
end
|
end
|
||||||
|
|
||||||
# borrowed from https://github.com/github/graphql-docs/blob/master/lib/graphql_docs/update_internal_developer/idl.rb
|
# borrowed from graphql-docs/lib/graphql_docs/update_internal_developer/idl.rb
|
||||||
class Printer < GraphQL::Language::DocumentFromSchemaDefinition
|
class Printer < GraphQL::Language::DocumentFromSchemaDefinition
|
||||||
def build_object_type_node(object_type)
|
def build_object_type_node(object_type)
|
||||||
apply_directives_to_node(object_type, super)
|
apply_directives_to_node(object_type, super)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
# [start-readme]
|
# [start-readme]
|
||||||
#
|
#
|
||||||
# Run this script to manually purge the [Fastly cache](https://github.com/github/docs-internal#fastly-cdn).
|
# Run this script to manually purge the Fastly cache.
|
||||||
# Note this script requires a `FASTLY_SERVICE_ID` and `FASTLY_TOKEN` in your `.env` file.
|
# Note this script requires a `FASTLY_SERVICE_ID` and `FASTLY_TOKEN` in your `.env` file.
|
||||||
#
|
#
|
||||||
# [end-readme]
|
# [end-readme]
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ const { getPathWithoutLanguage } = require('../lib/path-utils')
|
|||||||
|
|
||||||
// [start-readme]
|
// [start-readme]
|
||||||
//
|
//
|
||||||
// Run this script to manually purge the [Fastly cache](https://github.com/github/docs-internal#fastly-cdn)
|
// Run this script to manually purge the Fastly cache
|
||||||
// for all language variants of a single URL or for a batch of URLs in a file. This script does
|
// for all language variants of a single URL or for a batch of URLs in a file. This script does
|
||||||
// not require authentication.
|
// not require authentication.
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -14,7 +14,15 @@ const contentFiles = walk(contentDir, { includeBasePath: true })
|
|||||||
// [start-readme]
|
// [start-readme]
|
||||||
//
|
//
|
||||||
// Run this script to standardize frontmatter fields in all content files,
|
// Run this script to standardize frontmatter fields in all content files,
|
||||||
// per the order decided in https://github.com/github/docs-internal/issues/9658#issuecomment-485536265.
|
// per the order:
|
||||||
|
// - title
|
||||||
|
// - intro
|
||||||
|
// - product callout
|
||||||
|
// - productVersion
|
||||||
|
// - map topic status
|
||||||
|
// - hidden status
|
||||||
|
// - layout
|
||||||
|
// - redirect
|
||||||
//
|
//
|
||||||
// [end-readme]
|
// [end-readme]
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ const jsonFile = require(filename)
|
|||||||
// [start-readme]
|
// [start-readme]
|
||||||
//
|
//
|
||||||
// Run this script during Enterprise releases and deprecations.
|
// Run this script during Enterprise releases and deprecations.
|
||||||
// It uses the GitHub API to get dates from [`enterprise-releases`](https://github.com/github/enterprise-releases/blob/master/releases.json) and updates `lib/enterprise-dates.json`.
|
// It uses the GitHub API to get dates from enterprise-releases and updates `lib/enterprise-dates.json`.
|
||||||
// The help site uses this JSON to display dates at the top of some Enterprise versions.
|
// The help site uses this JSON to display dates at the top of some Enterprise versions.
|
||||||
//
|
//
|
||||||
// This script requires that you have a GitHub Personal Access Token in a `.env` file.
|
// This script requires that you have a GitHub Personal Access Token in a `.env` file.
|
||||||
@@ -26,8 +26,7 @@ const jsonFile = require(filename)
|
|||||||
|
|
||||||
main()
|
main()
|
||||||
|
|
||||||
// GHE Release Lifecycle Dates:
|
// GHE Release Lifecycle Dates
|
||||||
// https://github.com/github/enterprise-releases/blob/master/releases.json
|
|
||||||
async function main () {
|
async function main () {
|
||||||
let raw
|
let raw
|
||||||
try {
|
try {
|
||||||
@@ -38,7 +37,7 @@ async function main () {
|
|||||||
}
|
}
|
||||||
const json = prepareData(raw)
|
const json = prepareData(raw)
|
||||||
if (json === prettify(jsonFile)) {
|
if (json === prettify(jsonFile)) {
|
||||||
console.log('This repo is already in sync with https://github.com/github/enterprise-releases/blob/master/releases.json!')
|
console.log('This repo is already in sync with enterprise-releases!')
|
||||||
} else {
|
} else {
|
||||||
fs.writeFileSync(filename, json, 'utf8')
|
fs.writeFileSync(filename, json, 'utf8')
|
||||||
console.log(`${filename} has been updated!`)
|
console.log(`${filename} has been updated!`)
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ const authenticateToAWS = require('../lib/authenticate-to-aws.js')
|
|||||||
// [start-readme]
|
// [start-readme]
|
||||||
//
|
//
|
||||||
// This script is used by other scripts to update temporary AWS credentials and authenticate to S3.
|
// This script is used by other scripts to update temporary AWS credentials and authenticate to S3.
|
||||||
// See docs at [Setting up awssume and S3cmd](https://github.com/github/product-documentation/tree/master/doc-team-workflows/workflow-information-for-all-writers/setting-up-awssume-and-s3cmd.md).
|
|
||||||
//
|
//
|
||||||
// [end-readme]
|
// [end-readme]
|
||||||
|
|
||||||
|
|||||||
59
tests/meta/repository-references.js
Normal file
59
tests/meta/repository-references.js
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
const walkSync = require('walk-sync')
|
||||||
|
const fs = require('fs').promises
|
||||||
|
|
||||||
|
const REPO_REGEXP = /\/\/github\.com\/github\/(?!docs[/'"\n])([\w-.]+)/gi
|
||||||
|
|
||||||
|
// These are a list of known public repositories in the GitHub organization
|
||||||
|
const ALLOW_LIST = new Set([
|
||||||
|
'site-policy',
|
||||||
|
'roadmap',
|
||||||
|
'linguist',
|
||||||
|
'super-linter',
|
||||||
|
'backup-utils',
|
||||||
|
'codeql-action-sync-tool',
|
||||||
|
'codeql-action',
|
||||||
|
'platform-samples',
|
||||||
|
'github-services',
|
||||||
|
'explore',
|
||||||
|
'markup',
|
||||||
|
'hubot',
|
||||||
|
'VisualStudio',
|
||||||
|
'codeql',
|
||||||
|
'gitignore',
|
||||||
|
'feedback',
|
||||||
|
'semantic',
|
||||||
|
'git-lfs',
|
||||||
|
'git-sizer',
|
||||||
|
'dmca',
|
||||||
|
'gov-takedowns',
|
||||||
|
'janky',
|
||||||
|
'rest-api-description',
|
||||||
|
'smimesign',
|
||||||
|
'tweetsodium',
|
||||||
|
'choosealicense.com'
|
||||||
|
])
|
||||||
|
|
||||||
|
describe('check for repository references', () => {
|
||||||
|
const filenames = walkSync(process.cwd(), {
|
||||||
|
directories: false,
|
||||||
|
ignore: [
|
||||||
|
'.git',
|
||||||
|
'dist',
|
||||||
|
'node_modules',
|
||||||
|
'translations',
|
||||||
|
'lib/rest/**/*.json',
|
||||||
|
'lib/webhooks/**/*.json',
|
||||||
|
'ownership.yaml',
|
||||||
|
'docs/index.yaml',
|
||||||
|
'lib/excluded-links.js'
|
||||||
|
]
|
||||||
|
})
|
||||||
|
|
||||||
|
test.each(filenames)('in file %s', async (filename) => {
|
||||||
|
const file = await fs.readFile(filename, 'utf8')
|
||||||
|
const matches = Array.from(file.matchAll(REPO_REGEXP))
|
||||||
|
.map(([, repoName]) => repoName)
|
||||||
|
.filter(repoName => !ALLOW_LIST.has(repoName))
|
||||||
|
expect(matches).toHaveLength(0)
|
||||||
|
})
|
||||||
|
})
|
||||||
@@ -91,7 +91,7 @@ describe('server', () => {
|
|||||||
expect($.res.statusCode).toBe(400)
|
expect($.res.statusCode).toBe(400)
|
||||||
})
|
})
|
||||||
|
|
||||||
// see https://github.com/github/docs-internal/issues/12427
|
// see issue 12427
|
||||||
test('renders a 404 for leading slashes', async () => {
|
test('renders a 404 for leading slashes', async () => {
|
||||||
let $ = await getDOM('//foo.com/enterprise')
|
let $ = await getDOM('//foo.com/enterprise')
|
||||||
expect($('h1').text()).toBe('Ooops!')
|
expect($('h1').text()).toBe('Ooops!')
|
||||||
@@ -131,7 +131,7 @@ describe('server', () => {
|
|||||||
expect($('div.permissions-statement').text()).toContain('GitHub Pages site')
|
expect($('div.permissions-statement').text()).toContain('GitHub Pages site')
|
||||||
})
|
})
|
||||||
|
|
||||||
// see https://github.com/github/docs-internal/issues/9678
|
// see issue 9678
|
||||||
test('does not use cached intros in map topics', async () => {
|
test('does not use cached intros in map topics', async () => {
|
||||||
let $ = await getDOM('/en/github/importing-your-projects-to-github/importing-a-git-repository-using-the-command-line')
|
let $ = await getDOM('/en/github/importing-your-projects-to-github/importing-a-git-repository-using-the-command-line')
|
||||||
const articleIntro = $('.lead-mktg').text()
|
const articleIntro = $('.lead-mktg').text()
|
||||||
|
|||||||
Reference in New Issue
Block a user