Skip to content

Commit 186fe3c

Browse files
authored
Merge pull request #33459 from github/repo-sync
Repo sync
2 parents d267cf3 + 1fb3887 commit 186fe3c

File tree

7 files changed

+85
-3
lines changed

7 files changed

+85
-3
lines changed

.github/workflows/codeql.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ on:
1010
- main
1111
paths:
1212
- '**/*.js'
13+
- '**/*.ts'
14+
- '**/*.jsx'
15+
- '**/*.tsx'
1316
- '.github/workflows/codeql.yml'
1417
# This is so that when CodeQL runs on a pull request, it can compare
1518
# against the state of the base branch.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
22
title: GitHub Copilot Enterprise
33
shortTitle: Copilot Enterprise
4-
intro: 'Learn about GitHub Copilot Enterprise and the features available with it.'
4+
intro: Learn about GitHub Copilot Enterprise and the features available with it.
55
topics:
66
- Copilot
77
versions:
88
feature: copilot
99
children:
1010
- /overview
1111
- /copilot-pull-request-summaries
12-
- /managing-copilot-knowledge-bases
1312
---
13+

content/copilot/managing-copilot/managing-github-copilot-in-your-organization/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ topics:
1313
children:
1414
- /subscribing-to-copilot-for-your-organization
1515
- /granting-access-to-copilot-for-members-of-your-organization
16+
- /managing-copilot-knowledge-bases
1617
- /managing-requests-for-copilot-access-in-your-organization
1718
- /revoking-access-to-copilot-for-members-of-your-organization
1819
- /reviewing-usage-data-for-github-copilot-in-your-organization
@@ -21,3 +22,4 @@ children:
2122
- /reviewing-audit-logs-for-copilot-business
2223
- /canceling-copilot-for-your-organization
2324
---
25+

content/copilot/github-copilot-enterprise/managing-copilot-knowledge-bases.md renamed to content/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-copilot-knowledge-bases.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ redirect_from:
1111
- /copilot/github-copilot-enterprise/copilot-docset-management
1212
- /copilot/github-copilot-enterprise/copilot-chat-in-github/managing-copilot-knowledge-bases
1313
- /copilot/github-copilot-chat/copilot-chat-in-github/managing-copilot-knowledge-bases
14+
- /copilot/github-copilot-enterprise/managing-copilot-knowledge-bases
1415
---
1516

1617
{% ifversion fpt %}

content/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-requests-for-copilot-access-in-your-organization.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Managing requests for copilot access in your organization
2+
title: Managing requests for Copilot access in your organization
33
shortTitle: Manage requests for access
44
intro: 'Approve or deny requests for {% data variables.product.prodname_copilot_short %} access in your organization.'
55
permissions: Organization owners

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"scripts": {
1919
"all-documents": "tsx src/content-render/scripts/all-documents/cli.ts",
2020
"analyze-text": "node src/search/scripts/analyze-text.js",
21+
"analyze-comment": "tsx src/events/scripts/analyze-comment-cli.ts",
2122
"archive-version": "node --max-old-space-size=8192 src/ghes-releases/scripts/archive-version.js",
2223
"audit-log-sync": "tsx src/audit-logs/scripts/sync.ts",
2324
"build": "next build",
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
/**
2+
* This script can be used to debug and test our signals.
3+
* Example use:
4+
*
5+
* npm run analyze-comment -- "I love this site\!" --verbose
6+
*
7+
* or, using stdin:
8+
*
9+
* cat naught-comment.txt | npm run analyze-comment
10+
*
11+
*/
12+
13+
import fs from 'node:fs'
14+
import util from 'node:util'
15+
16+
import chalk from 'chalk'
17+
import { program } from 'commander'
18+
19+
import { SIGNAL_RATINGS } from '../analyze-comment'
20+
21+
type Options = {
22+
language?: string
23+
verbose?: boolean
24+
}
25+
program
26+
.description('Analyze a single comment to test how it would be rated.')
27+
.option('-l, --language <language>', 'Assumed language of the page')
28+
.option('-v, --verbose', "Display all signals it *didn't* trigger")
29+
.argument('[comment]', 'Input (leave blank to read from stdin)')
30+
.action(main)
31+
32+
program.parse(process.argv)
33+
34+
async function main(comment?: string, options?: Options) {
35+
if (!comment) {
36+
const stdinBuffer = fs.readFileSync(0) // STDIN_FILENO = 0
37+
comment = stdinBuffer.toString()
38+
}
39+
if (!comment.trim()) {
40+
console.error(chalk.red('No comment provided'))
41+
return process.exit(1)
42+
}
43+
44+
console.log(chalk.grey('Comment:'), chalk.bold(util.inspect(comment)))
45+
console.log('') // whitespace
46+
47+
const language = options?.language || 'en'
48+
49+
let rating = 1.0
50+
let broke = false
51+
for (const { reduction, name, validator } of SIGNAL_RATINGS) {
52+
const hit = validator(comment, language)
53+
if (hit) {
54+
console.log(
55+
chalk.yellow(
56+
`Triggered on ${chalk.bold(name)} (${chalk.bold(reduction.toFixed(1))} reduction)`,
57+
),
58+
)
59+
rating -= reduction
60+
if (rating <= 0) {
61+
console.log(chalk.red('Rating is now 0.0, stopping'))
62+
broke = true
63+
if (options?.verbose) {
64+
break
65+
}
66+
}
67+
} else if (options?.verbose) {
68+
console.log(chalk.green(`Not triggered on ${chalk.bold(name)}`))
69+
}
70+
}
71+
console.log('') // whitespace
72+
if (!broke) {
73+
console.log(chalk.whiteBright(`Final rating: ${chalk.bold(rating.toFixed(1))}`))
74+
}
75+
}

0 commit comments

Comments
 (0)