1
0
mirror of synced 2025-12-23 21:07:12 -05:00

Merge branch 'main' into find-page-in-version-redux

This commit is contained in:
Sarah Schneider
2020-11-24 13:02:46 -05:00
committed by GitHub
20 changed files with 236 additions and 191 deletions

View File

@@ -0,0 +1,36 @@
#!/usr/bin/env node
const fs = require('fs')
const core = require('@actions/core')
const eventPayload = JSON.parse(fs.readFileSync(process.env.GITHUB_EVENT_PATH, 'utf8'))
// This workflow-run script does the following:
// 1. Gets an array of labels on a PR.
// 2. Finds one with the relevant Algolia text; if none found, exits early.
// 3. Gets the version substring from the label string.
const labelText = 'sync-english-index-for-'
const labelsArray = eventPayload.pull_request.labels
// Exit early if no labels are on this PR
if (!(labelsArray && labelsArray.length)) {
process.exit(0)
}
// Find the relevant label
const algoliaLabel = labelsArray
.map(label => label.name)
.find(label => label.startsWith(labelText))
// Exit early if no relevant label is found
if (!algoliaLabel) {
process.exit(0)
}
// Given: sync-english-index-for-enterprise-server@3.0
// Returns: enterprise-server@3.0
const versionToSync = algoliaLabel.split(labelText)[1]
// Store the version so we can access it later in the workflow
core.setOutput('versionToSync', versionToSync)
process.exit(0)

View File

@@ -3,6 +3,8 @@ name: Algolia Sync Single English Index
on:
pull_request:
types:
- labeled
- unlabeled
- opened
- reopened
- synchronize
@@ -13,7 +15,7 @@ on:
jobs:
updateIndices:
name: Update English index for single version based on a label's version
if: github.repository == 'github/docs-internal' && startsWith(github.event.label.name, 'sync-english-index-for-')
if: github.repository == 'github/docs-internal'
runs-on: ubuntu-latest
steps:
- name: checkout
@@ -30,13 +32,13 @@ jobs:
${{ runner.os }}-node-
- name: npm ci
run: npm ci
- name: Get version from label
- name: Get version from Algolia label if present; only continue if the label is found.
id: getVersion
run: |
echo "::set-output name=version::$(github.event.label.name.split('sync-english-index-for-')[1])"
- name: Sync English index for single version
run: $GITHUB_WORKSPACE/.github/actions-scripts/enterprise-algolia-label.js
- if: ${{ steps.getVersion.outputs.versionToSync }}
name: Sync English index for single version
env:
VERSION: ${{ steps.getVersion.outputs.version }}
VERSION: ${{ steps.getVersion.outputs.versionToSync }}
LANGUAGE: 'en'
ALGOLIA_APPLICATION_ID: ${{ secrets.ALGOLIA_APPLICATION_ID }}
ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }}

View File

@@ -164,6 +164,12 @@ git:
</tr>
</table>
#### Using environment variables in a matrix
Travis CI and {% data variables.product.prodname_actions %} can both add custom environment variables to a test matrix, which allows you to refer to the variable in a later step.
In {% data variables.product.prodname_actions %}, you can use the `include` key to add custom environment variables to a matrix. {% data reusables.github-actions.matrix-variable-example %}
### Key features in {% data variables.product.prodname_actions %}
When migrating from Travis CI, consider the following key features in {% data variables.product.prodname_actions %}:

View File

@@ -878,34 +878,9 @@ strategy:
##### Using environment variables in a matrix
You can add custom environment variables for each test combination by using `include` with `env`. You can then refer to the custom environment variables in a later step.
You can add custom environment variables for each test combination by using the `include` key. You can then refer to the custom environment variables in a later step.
In this example, the matrix entries for `node-version` are each configured to use different values for the `site` and `datacenter` environment variables. The `Echo site details` step then uses {% raw %}`env: ${{ matrix.env }}`{% endraw %} to refer to the custom variables:
{% raw %}
```yaml
name: Node.js CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- node-version: 10.x
site: "prod"
datacenter: "site-a"
- node-version: 12.x
site: "dev"
datacenter: "site-b"
steps:
- name: Echo site details
env:
SITE: ${{ matrix.site }}
DATACENTER: ${{ matrix.datacenter }}
run: echo $SITE $DATACENTER
```
{% endraw %}
{% data reusables.github-actions.matrix-variable-example %}
### **`jobs.<job_id>.strategy.fail-fast`**

View File

@@ -63,7 +63,9 @@ Before you define a secondary datacenter for your passive nodes, ensure that you
4. {% data reusables.enterprise_clustering.configuration-file-heading %} Under each node's heading, add a new key-value pair to assign the node to a datacenter. Use the same value as `primary-datacenter` from step 3 above. For example, if you want to use the default name (`default`), add the following key-value pair to the section for each node.
```
datacenter = default
```
When you're done, the section for each node in the cluster configuration file should look like the following example. {% data reusables.enterprise_clustering.key-value-pair-order-irrelevant %}
@@ -80,7 +82,9 @@ Before you define a secondary datacenter for your passive nodes, ensure that you
**Note**: If you changed the name of the primary datacenter in step 3, find the `consul-datacenter` key-value pair in the section for each node and change the value to the renamed primary datacenter. For example, if you named the primary datacenter `primary`, use the following key-value pair for each node.
```
consul-datacenter = primary
```
{% endnote %}
@@ -113,15 +117,21 @@ For an example configuration, see "[Example configuration](#example-configuratio
3. Back up your existing cluster configuration.
```
cp /data/user/common/cluster.conf ~/$(date +%Y-%m-%d)-cluster.conf.backup
```
4. Create a copy of your existing cluster configuration file in a temporary location, like _/home/admin/cluster-passive.conf_. Delete unique key-value pairs for IP addresses (`ipv*`), UUIDs (`uuid`), and public keys for WireGuard (`wireguard-pubkey`).
```
grep -Ev "(?:|ipv|uuid|vpn|wireguard\-pubkey)" /data/user/common/cluster.conf > ~/cluster-passive.conf
```
5. Remove the `[cluster]` section from the temporary cluster configuration file that you copied in the previous step.
```
git config -f ~/cluster-passive.conf --remove-section cluster
```
6. Decide on a name for the secondary datacenter where you provisioned your passive nodes, then update the temporary cluster configuration file with the new datacenter name. Replace `SECONDARY` with the name you choose.
@@ -294,19 +304,27 @@ You can monitor the progress on any node in the cluster, using command-line tool
- Monitor replication of databases:
```
/usr/local/share/enterprise/ghe-cluster-status-mysql
```
- Monitor replication of repository and Gist data:
```
ghe-spokes status
```
- Monitor replication of attachment and LFS data:
```
ghe-storage replication-status
```
- Monitor replication of Pages data:
```
ghe-dpages replication-status
```
You can use `ghe-cluster-status` to review the overall health of your cluster. For more information, see "[Command-line utilities](/enterprise/admin/configuration/command-line-utilities#ghe-cluster-status)."

View File

@@ -27,7 +27,7 @@ Before launching {% data variables.product.product_location %} on Google Cloud P
{% data variables.product.prodname_ghe_server %} is supported on the following Google Compute Engine (GCE) machine types. For more information, see [the Google Cloud Platform machine types article](https://cloud.google.com/compute/docs/machine-types).
| High-memory |
------------- |
| ------------- |
| n1-highmem-4 |
| n1-highmem-8 |
| n1-highmem-16 |

View File

@@ -220,7 +220,7 @@ end
#### Define a route handler
An empty route is included in the template code. This code handles all `POST` requests to the `/event_handler` route. You'll won't write this event handler in this quickstart, but see the other [quickstart guides](/apps/quickstart-guides/) for examples of how to extend this template app.
An empty route is included in the template code. This code handles all `POST` requests to the `/event_handler` route. You won't write this event handler in this quickstart, but see the other [quickstart guides](/apps/quickstart-guides/) for examples of how to extend this template app.
``` ruby
post '/event_handler' do

View File

@@ -428,9 +428,9 @@ For more information, see "[Restricting publication of {% data variables.product
| Action | Description
|------------------|-------------------
| `close` | Triggered when someone closes a security advisory. For more information, see "[About {% data variables.product.prodname_dotcom %} Security Advisories](/github/managing-security-vulnerabilities/about-github-security-advisories)."
| `cve_request` | Triggered when someone requests a CVE (Common Vulnerabilities and Exposures) number from {% data.variables.product.prodname_dotcom %} for a draft security advisory.
| `github_broadcast` | Triggered when {% data.variables.product.prodname_dotcom %} makes a security advisory public in the {% data variables.product.prodname_advisory_database %}.
| `github_withdraw` | Triggered when {% data.variables.product.prodname_dotcom %} withdraws a security advisory that was published in error.
| `cve_request` | Triggered when someone requests a CVE (Common Vulnerabilities and Exposures) number from {% data variables.product.prodname_dotcom %} for a draft security advisory.
| `github_broadcast` | Triggered when {% data variables.product.prodname_dotcom %} makes a security advisory public in the {% data variables.product.prodname_advisory_database %}.
| `github_withdraw` | Triggered when {% data variables.product.prodname_dotcom %} withdraws a security advisory that was published in error.
| `open` | Triggered when someone opens a draft security advisory.
| `publish` | Triggered when someone publishes a security advisory.
| `reopen` | Triggered when someone reopens as draft security advisory.

View File

@@ -11,7 +11,7 @@ versions:
{% data reusables.user_settings.access_settings %}
{% data reusables.user_settings.developer_settings %}
3. In the left sidebar, click **{% data variables.product.prodname_oauth_app %}s**.
![{ site.data.variables.product.prodname_oauth_app }}s tab in the left sidebar](/assets/images/help/settings/developer-settings-oauth-apps.png)
![{% data variables.product.prodname_oauth_app %}s tab in the left sidebar](/assets/images/help/settings/developer-settings-oauth-apps.png)
3. Click **Register a new application**.
4. Under **Application name**, type "Jira".
5. Under **Homepage URL**, type the full URL to your Jira instance.

View File

@@ -1,6 +1,6 @@
---
title: Enabling a link between GitHub Insights and GitHub Enterprise
intro: 'You can enable a link that will allow users to navigate from {% data variables.product.prodname_ghe_server %} to {{ site.data.variables.product.prodname_insights }}.'
intro: 'You can enable a link that will allow users to navigate from {% data variables.product.prodname_ghe_server %} to {% data variables.product.prodname_insights %}.'
product: '{% data reusables.gated-features.github-insights %}'
permissions: 'Site administrators for {% data variables.product.prodname_ghe_server %} can enable a link between {% data variables.product.prodname_ghe_server %} and {% data variables.product.prodname_insights %}.'
redirect_from:

View File

@@ -16,10 +16,6 @@ To delete a container image, you must have admin permissions to the container im
When deleting public packages, be aware that you may break projects that depend on your package.
### Reserved package versions and names
{% data reusables.package_registry.package-immutability %}
### Deleting a version of a user-owned container image on {% data variables.product.prodname_dotcom %}
{% data reusables.package_registry.package-settings-from-user-level %}

View File

@@ -35,10 +35,6 @@ At this time, {% data variables.product.prodname_registry %} on {% data variable
{% endif %}
### Reserved package versions and names
{% data reusables.package_registry.package-immutability %}
### Deleting a version of a private package on {% data variables.product.product_name %}
To delete a private package version, you must have admin permissions in the repository.

View File

@@ -18,8 +18,6 @@ You can help people understand and use your package by providing a description a
{% data reusables.package_registry.public-or-private-packages %} A repository can contain more than one package. To prevent confusion, make sure the README and description clearly provide information about each package.
{% data reusables.package_registry.package-immutability %}
{% if currentVersion == "free-pro-team@latest" %}
If a new version of a package fixes a security vulnerability, you should publish a security advisory in your repository. {% data variables.product.prodname_dotcom %} reviews each published security advisory and may use it to send {% data variables.product.prodname_dependabot_alerts %} to affected repositories. For more information, see "[About GitHub Security Advisories](/github/managing-security-vulnerabilities/about-github-security-advisories)."
{% endif %}

View File

@@ -0,0 +1,26 @@
In this example, the matrix entries for `node-version` are each configured to use different values for the `site` and `datacenter` environment variables. The `Echo site details` step then uses {% raw %}`env: ${{ matrix.env }}`{% endraw %} to refer to the custom variables:
{% raw %}
```yaml
name: Node.js CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- node-version: 10.x
site: "prod"
datacenter: "site-a"
- node-version: 12.x
site: "dev"
datacenter: "site-b"
steps:
- name: Echo site details
env:
SITE: ${{ matrix.site }}
DATACENTER: ${{ matrix.datacenter }}
run: echo $SITE $DATACENTER
```
{% endraw %}

View File

@@ -1,5 +0,0 @@
**Public packages:** To prevent confusion and build problems, {% data variables.product.prodname_dotcom %} permanently reserves a package's name and version number. Even if an entire package is deleted, you cannot reuse the deleted package name in any repository owned by the same account.
**Private packages:** If all versions of a private package are deleted, you can publish a package with a previously used name and version.
To revise or replace a package version, we recommend you publish a new version of your package.

View File

@@ -77,6 +77,7 @@
"webpack-cli": "^3.3.12"
},
"devDependencies": {
"@actions/core": "^1.2.6",
"ajv": "^6.11.0",
"async": "^3.2.0",
"await-sleep": "0.0.1",

View File

@@ -2,7 +2,6 @@ const path = require('path')
const slash = require('slash')
const fs = require('fs')
const walk = require('walk-sync')
const matter = require('@github-docs/frontmatter')
const { zip } = require('lodash')
const yaml = require('js-yaml')
const languages = require('../../lib/languages')
@@ -81,19 +80,19 @@ const versionLinkRegEx = /(?=^|[^\]]\s*)\[[^\]]+\](?::\n?[ \t]+|\s*\()(?:(?:http
const domainLinkRegex = /(?=^|[^\]]\s*)\[[^\]]+\](?::\n?[ \t]+|\s*\()(?:https?:)?\/\/(?:help|docs|developer)\.github\.com(?!\/changes\/)[^)\s]*(?:\)|\s+|$)/gm
// {{ site.data.example.pizza }}
const oldVariableRegex = /{{\s?site\.data\..*}}/g
const oldVariableRegex = /{{\s*?site\.data\..*?}}/g
// - {{ octicon-plus }}
// - {{ octicon-plus An example label }}
//
const oldOcticonRegex = /{{\s?octicon-([a-z-]+)(\s[\w\s\d-]+)?\s?}}/g
const oldOcticonRegex = /{{\s*?octicon-([a-z-]+)(\s[\w\s\d-]+)?\s*?}}/g
// - {{#note}}
// - {{/note}}
// - {{ #warning }}
// - {{ /pizza }}
//
const oldExtendedMarkdownRegex = /{{\s?[#/][a-z-]+\s?}}/g
const oldExtendedMarkdownRegex = /{{\s*?[#/][a-z-]+\s*?}}/g
const relativeArticleLinkErrorText = 'Found unexpected relative article links:'
const languageLinkErrorText = 'Found article links with hard-coded language codes:'
@@ -125,10 +124,7 @@ describe('lint-files', () => {
let content
beforeAll(async () => {
const fileContents = await fs.promises.readFile(markdownAbsPath, 'utf8')
const { content: bodyContent } = matter(fileContents)
content = bodyContent
content = await fs.promises.readFile(markdownAbsPath, 'utf8')
})
test('relative URLs must start with "/"', async () => {
@@ -214,7 +210,7 @@ describe('lint-files', () => {
const matches = (content.match(oldVariableRegex) || [])
const matchesWithExample = matches.map(match => {
const example = match
.replace(/{{\s?site\.data\.([a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]+)+)\s*}}/g, '{% data $1 %}')
.replace(/{{\s*?site\.data\.([a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]+)+)\s*?}}/g, '{% data $1 %}')
return `${match} => ${example}`
})
const errorMessage = formatLinkError(oldVariableErrorText, matchesWithExample)
@@ -229,7 +225,7 @@ describe('lint-files', () => {
test('does not use old extended markdown syntax', async () => {
Object.keys(tags).forEach(tag => {
const reg = new RegExp(`{{\\s?[#|/]${tag}`, 'g')
const reg = new RegExp(`{{\\s*?[#|/]${tag}`, 'g')
if (reg.test(content)) {
const matches = (content.match(oldExtendedMarkdownRegex)) || []
const tagMessage = oldExtendedMarkdownErrorText
@@ -334,7 +330,7 @@ describe('lint-files', () => {
if (valMatches.length > 0) {
matches.push(...valMatches.map((match) => {
const example = match
.replace(/{{\s?site\.data\.([a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]+)+)\s*}}/g, '{% data $1 %}')
.replace(/{{\s*?site\.data\.([a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]+)+)\s*?}}/g, '{% data $1 %}')
return `Key "${key}": ${match} => ${example}`
}))
}