1
0
mirror of synced 2026-02-03 00:02:00 -05:00

Merge branch 'main' into repo-sync

This commit is contained in:
Octomerger Bot
2021-10-18 16:23:09 -04:00
committed by GitHub
8 changed files with 37 additions and 12 deletions

View File

@@ -28,4 +28,4 @@ jobs:
run: npm ci
- name: Run linter
run: npx eslint .
run: npm run lint

View File

@@ -52,6 +52,4 @@ jobs:
run: npm run build
- name: Run tests
run: npx jest tests/${{ matrix.test-group }}/
env:
NODE_OPTIONS: '--max_old_space_size=8192'
run: npm run test tests/${{ matrix.test-group }}/

View File

@@ -57,6 +57,4 @@ jobs:
run: npm run build
- name: Run tests
run: npx jest tests/${{ matrix.test-group }}/
env:
NODE_OPTIONS: '--max_old_space_size=8192 --experimental-vm-modules'
run: npm run test tests/${{ matrix.test-group }}/

View File

@@ -467,6 +467,35 @@ Where the first reference concerns `cents` or a non-dollar amount, capitalize th
See the “Inclusive language” section of this guide.
### Permissions
A **permission** is the ability to perform a specific action. For example, the ability to delete an issue is a permission.
A **role** is a set of permissions that can be assigned to a user. Roles exist at different levels.
- Accounts (e.g., organization owner, billing manager for an enterprise account)
- Resources (e.g., "Write" for a repository, "Admin" for a security advisory)
- Teams (e.g., "team maintainer")
A person's **access** refers generally to all the abilities the person has in a particular context, regardless of which roles or individual permissions those abilities come from.
Only use **permission** or **role** when the distinction between the two is important. Otherwise, use **access**.
- **Use:** `To create a custom repository role, you choose an inherited role and then add individual permissions.`
- **Use:** `Managing a team's access to your organization's repository`
- **Use:** `If your team membership gives you a different level of access than your role as organization owner...`
- **Use:** `People with write access can...`
- **Avoid:** `People with the write role can...`
- **Avoid:** `People with write permissions can...`
- **Avoid:** `People with write privileges can...`
When specifying the access required to take an action, refer only to the role at the same level as the action. For example, you need admin access to a repository, which is a repository-level role, to configure protected branches. You can get admin access to a repository by being an organization owner, an organization-level role, but the repository-level role is what actually governs your ability to take the action, so that is the only role that should be mentioned.
- **Use:** `People with write access to a repository can do X to the repository.`
- **Avoid:** `Organization owners and people with write access can do X to the repository.`
For more information about word choice for permissions statments, see "[Permissions statements](/contributing/content-model.md#permissions-statements)" in the content model.
### Prepositions
Avoid ending a sentence with a preposition unless the rewritten sentence would sound awkward or too formal.

View File

@@ -19,7 +19,7 @@ export default function handleRedirects(req, res, next) {
language = req.context.userLanguage
}
return res.redirect(301, `/${language}`)
return res.redirect(302, `/${language}`)
}
// begin redirect handling

View File

@@ -221,7 +221,7 @@
"sync-search-ghes-release": "cross-env GHES_RELEASE=1 start-server-and-test sync-search-server 4002 sync-search-indices",
"sync-search-indices": "script/sync-search-indices.js",
"sync-search-server": "cross-env NODE_ENV=production WEB_CONCURRENCY=1 PORT=4002 node server.mjs",
"test": "npm run lint && cross-env NODE_OPTIONS=--experimental-vm-modules jest",
"test": "cross-env NODE_OPTIONS='--max_old_space_size=8192 --experimental-vm-modules' jest",
"test-watch": "cross-env NODE_OPTIONS=--experimental-vm-modules jest --watch --notify --notifyMode=change --coverage"
},
"lint-staged": {

View File

@@ -631,7 +631,7 @@ describe('server', () => {
test('redirects / to /en', async () => {
const res = await get('/')
expect(res.statusCode).toBe(301)
expect(res.statusCode).toBe(302)
expect(res.headers.location).toBe('/en')
})

View File

@@ -131,13 +131,13 @@ describe('redirects', () => {
describe('home page redirects', () => {
test('homepage redirects to english by default', async () => {
const res = await get('/')
expect(res.statusCode).toBe(301)
expect(res.statusCode).toBe(302)
expect(res.headers.location).toBe('/en')
})
test('homepage redirects to preferred language', async () => {
const res = await get('/', { headers: { 'Accept-Language': 'ja' } })
expect(res.statusCode).toBe(301)
expect(res.statusCode).toBe(302)
expect(res.headers.location).toBe('/ja')
})
})