Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repo sync #26115

Merged
merged 9 commits into from
Jun 20, 2023
9 changes: 2 additions & 7 deletions .github/workflows/close-bad-repo-sync-prs.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
name: Close bad repo-sync PRs

# **What it does**:
# Closes and PR from `repo-sync` to `main` that wasn't created by
# Octomerger or a Hubber.
# Closes and PR from `repo-sync` to `main` that wasn't created by a Hubber.
# **Why we have it**:
# Unfortunately, a lot of PRs in github/docs are created by people who
# shouldn't be creating such PRs. We bot our bots to own it.
Expand All @@ -17,7 +16,7 @@ permissions:

jobs:
close-invalid-repo-sync-pr:
if: ${{ github.repository == 'github/docs' && github.actor != 'Octomerger' && github.event.pull_request.base.ref == 'main' && github.event.pull_request.head.ref == 'repo-sync' }}
if: ${{ github.repository == 'github/docs' && github.event.pull_request.base.ref == 'main' && github.event.pull_request.head.ref == 'repo-sync' }}
name: Close if invalid repo-sync PR author
runs-on: ubuntu-latest
steps:
Expand All @@ -30,10 +29,6 @@ jobs:
const prCreator = context.actor
const prNumber = context.issue.number

if (prCreator === 'Octomerger') {
throw new Error("Should have been checked by the main if: condition on the job")
}

try {
await github.rest.teams.getMembershipForUserInOrg({
org: 'github',
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/content-changes-table-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ concurrency:

jobs:
PR-Preview-Links:
if: github.event.pull_request.user.login != 'Octomerger' && (github.repository == 'github/docs-internal' || github.repository == 'github/docs')
if: github.event.pull_request.user.login != 'docs-bot' && (github.repository == 'github/docs-internal' || github.repository == 'github/docs')
name: Add staging/live links to PR
runs-on: ubuntu-latest
outputs:
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/first-responder-docs-content.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ jobs:
`/orgs/github/teams/docs/members?per_page=100`
)
const teamLogins = teamMembers.data.map(member => member.login)
// ignore PRs opened by docs bot accounts
teamLogins.push('Octomerger', 'octoglot')
if (teamLogins.some(login => login === updatedIssueInformation.data.user.login)) {
console.log(`This issue or pull request was authored by a member of the github/docs team.`)
return 'true'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/merged-notification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ permissions:

jobs:
comment:
if: github.repository == 'github/docs' && github.event.pull_request.merged && github.event.pull_request.base.ref == github.event.repository.default_branch && github.event.pull_request.user.login != 'Octomerger'
if: github.repository == 'github/docs' && github.event.pull_request.merged && github.event.pull_request.base.ref == github.event.repository.default_branch && github.event.pull_request.user.login != 'docs-bot'
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/repo-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@ jobs:

- name: Sync repo to branch
uses: repo-sync/github-sync@3832fe8e2be32372e1b3970bbae8e7079edeec88
env:
GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_WORKFLOW }}
with:
source_repo: ${{ secrets.SOURCE_REPO }} # https://${access_token}@github.com/github/the-other-repo.git
source_repo: https://${{ secrets.DOCS_BOT_PAT_WORKFLOW }}@github.com/github/${{ github.repository == 'github/docs-internal' && 'docs' || 'docs-internal' }}.git
source_branch: main
destination_branch: repo-sync
github_token: ${{ secrets.DOCS_BOT_PAT_WORKFLOW }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/triage-unallowed-contributions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
if: >-
${{
github.repository == 'github/docs' &&
github.event.pull_request.user.login != 'Octomerger' &&
github.event.pull_request.user.login != 'docs-bot' &&
github.event.pull_request.user.login != 'dependabot[bot]'
}}
runs-on: ubuntu-latest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,22 @@ You can also use a command-line utility to configure the IP exception list. For

You can schedule maintenance for different times or dates with the {% data variables.product.prodname_enterprise_api %}. For more information, see "[AUTOTITLE](/rest/enterprise-admin#enable-or-disable-maintenance-mode)."

## Enabling or disabling maintenance mode for all nodes in a cluster
## Enabling or disabling maintenance mode for {% data variables.product.prodname_ghe_server %} via the CLI

With the `ghe-maintenance` utility, you can set or unset maintenance mode for a single instance of {% data variables.product.prodname_ghe_server %}.

```shell
$ ghe-maintenance -h
# Shows options
$ ghe-maintenance -q
# Queries the current mode
$ ghe-maintenance -s
# Sets maintenance mode
$ ghe-maintenance -u
# Unsets maintenance mode
```

## Enabling or disabling maintenance mode for all nodes in a cluster via the CLI

With the `ghe-cluster-maintenance` utility, you can set or unset maintenance mode for every node in a cluster.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,13 @@ The following properties are supported in `qlpack.yml` files.
upgrades: .
```

#### `warnOnImplicitThis`
- Optional. Defaults to `false` if the `warnOnImplicitThis` property is not defined.
- Defines a boolean that specifies whether or not the compiler should emit warnings about member predicate calls with implicit `this` call receivers, that is, without an explicit receiver. Supported from {% data variables.product.prodname_codeql_cli %} version 2.13.2 and onwards. For example:
```yaml
warnOnImplicitThis: true
```

## About `codeql-pack.lock.yml` files

`codeql-pack.lock.yml` files store the versions of the resolved transitive dependencies of a {% data variables.product.prodname_codeql %} pack. This file is created by the `codeql pack install` command if it does not already exist and should be added to your version control system. The `dependencies` section of the `qlpack.yml` file contains version ranges that are compatible with the pack. The `codeql-pack.lock.yml` file locks the versions to precise dependencies. This ensures that running `codeql pack install` on this the pack will always retrieve the same versions of dependencies even if newer compatible versions exist.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ To set up a `www` or custom subdomain, such as `www.example.com` or `blog.exampl
4. Under "Custom domain", type your custom domain, then click **Save**. If you are publishing your site from a branch, this will create a commit that adds a `CNAME` file to the root of your source branch. If you are publishing your site with a custom {% data variables.product.prodname_actions %} workflow , no `CNAME` file is created. For more information about your publishing source, see "[AUTOTITLE](/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site)."

{% note %}

**Note:** If your custom domain is an internationalized domain name, you must enter the Punycode encoded version.

For more information on Punycodes, see [Internationalized domain name](https://en.wikipedia.org/wiki/Internationalized_domain_name).

{% endnote %}

1. Navigate to your DNS provider and create a `CNAME` record that points your subdomain to the default domain for your site. For example, if you want to use the subdomain `www.example.com` for your user site, create a `CNAME` record that points `www.example.com` to `<user>.github.io`. If you want to use the subdomain `another.example.com` for your organization site, create a `CNAME` record that points `another.example.com` to `<organization>.github.io`. The `CNAME` record should always point to `<user>.github.io` or `<organization>.github.io`, excluding the repository name. {% data reusables.pages.contact-dns-provider %} {% data reusables.pages.default-domain-information %}
Expand Down Expand Up @@ -138,12 +138,16 @@ After you configure the apex domain, you must configure a CNAME record with your
> YOUR-USERNAME.github.io. 43192 IN CNAME GITHUB-PAGES-SERVER.
> GITHUB-PAGES-SERVER. 22 IN A 192.0.2.1
```

## Removing a custom domain

If you get an error about a custom domain being taken, you may need to remove the custom domain from another repository.

{% data reusables.pages.navigate-site-repo %}
{% data reusables.repositories.sidebar-settings %}
{% data reusables.pages.sidebar-pages %}
4. Under "Custom domain," click **Remove**.
1. Under "Custom domain," click **Remove**.

![Screenshot of a settings box to save or remove a custom domain on {% data variables.product.prodname_pages %} . To the right of a text box reading "example.com" is a button labeled "Remove" in red type.](/assets/images/help/pages/remove-custom-domain.png)

## Securing your custom domain
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ remote: error: Required status check "ci-build" is failing

## Conflicts between head commit and test merge commit

Sometimes, the results of the status checks for the test merge commit and head commit will conflict. If the test merge commit has a status, the test merge commit must pass. Otherwise, the status of the head commit must pass before you can merge the branch. For more information about test merge commits, see "[AUTOTITLE](/rest/pulls#get-a-pull-request)."
Sometimes, the results of the status checks for the test merge commit and head commit will conflict. If the test merge commit has a status, the test merge commit must pass. Otherwise, the status of the head commit must pass before you can merge the branch.

If there is a conflict between the test merge commit and head commit, the checks for the test merge commit are shown in the pull request status checks box. This is indicated in the pull request status box by a line starting with `Showing checks for the merge commit`. For more information about test merge commits, see "[AUTOTITLE](/rest/pulls#get-a-pull-request)."

## Handling skipped but required checks

Expand Down
2 changes: 1 addition & 1 deletion script/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Runs tests. Equivalent of `npm test`.

### [`anonymize-branch.js`](anonymize-branch.js)

Flatten all the commits in the current branch into a single anonymized @Octomerger commit
Flatten all the commits in the current branch into a single anonymized @docs-bot commit

Usage: script/anonymize-branch.js <new-commit-message> [base-branch] Example: script/anonymize-branch.js "nothing to see here" If the optional [base-branch] argument is omitted, it will default to `main`

Expand Down
6 changes: 3 additions & 3 deletions script/anonymize-branch.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// [start-readme]
//
// Flatten all the commits in the current branch into a single anonymized @Octomerger commit
// Flatten all the commits in the current branch into a single anonymized @docs-bot commit
//
// Usage: script/anonymize-branch.js <new-commit-message> [base-branch]
// Example: script/anonymize-branch.js "nothing to see here"
Expand All @@ -13,9 +13,9 @@
import { execSync as exec } from 'child_process'
import path from 'path'

process.env.GIT_AUTHOR_NAME = process.env.GIT_COMMITTER_NAME = 'Octomerger Bot'
process.env.GIT_AUTHOR_NAME = process.env.GIT_COMMITTER_NAME = 'Docs Bot'
process.env.GIT_AUTHOR_EMAIL = process.env.GIT_COMMITTER_EMAIL =
'63058869+Octomerger@users.noreply.github.com'
'63058869+docs-bot@users.noreply.github.com'

const args = process.argv.slice(2)
const message = args[0]
Expand Down
2 changes: 2 additions & 0 deletions src/content-linter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ We are using the [markdownlint](https://github.com/DavidAnson/markdownlint) fram
| [MD024](https://github.com/DavidAnson/markdownlint/blob/main/doc/md024.md) | Disallow headings with the same content. | error |
| [MD027](https://github.com/DavidAnson/markdownlint/blob/main/doc/md027.md) | Catches multiple spaces after blockquote symbol. | warning |
| [MD030](https://github.com/DavidAnson/markdownlint/blob/main/doc/md030.md) | Only allow one space after list markers. | error |
| [MD039](https://github.com/DavidAnson/markdownlint/blob/main/doc/md039.md) | Remove spacing around image text. | warning |
| [MD042](https://github.com/DavidAnson/markdownlint/blob/main/doc/md042.md) | Do not allow empty links. | error |
| [MD011](https://github.com/DavidAnson/markdownlint/blob/main/doc/md011.md) | Make sure that link syntax is not reversed. | error |
| [MD111](./linting-rules/image-alt-text-length.js) | Images alternate text should be between 40-150 characters. | warning |
| [MD112](./linting-rules/image-alt-text-end-punctuation.js) | Images alternate text should end with a punctuation. | error |
Expand Down
2 changes: 2 additions & 0 deletions src/content-linter/scripts/markdownlint.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ async function main() {
MD024: true,
MD027: true,
MD030: true,
MD039: true,
MD042: true,
MD111: true,
MD112: true,
MD113: true,
Expand Down