Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,4 @@ Try the [Expand your team with {% data variables.copilot.copilot_cloud_agent %}]
* [AUTOTITLE](/copilot/how-tos/use-copilot-agents/cloud-agent) how-to articles
* [AUTOTITLE](/copilot/concepts/agents/cloud-agent/about-custom-agents)
* [AUTOTITLE](/copilot/responsible-use/agents)
* [AUTOTITLE](/copilot/concepts/agents/about-github-agentic-workflows) for recurring repository automation that you want to version with your code and run in {% data variables.product.prodname_actions %}
148 changes: 0 additions & 148 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,6 @@
"cross-env": "^10.1.0",
"csv-parse": "7.0.0",
"domhandler": "^5.0.3",
"escape-string-regexp": "5.0.0",
"eslint": "^9.39.3",
"eslint-config-prettier": "^10.1.8",
"eslint-import-resolver-typescript": "^4.4.4",
Expand All @@ -319,22 +318,19 @@
"husky": "^9.1.7",
"is-svg": "6.0.0",
"jiti": "^2.6.1",
"json-schema-merge-allof": "^0.8.1",
"lint-staged": "^17.0.4",
"lowdb": "7.0.1",
"markdownlint": "^0.34.0",
"markdownlint-rule-helpers": "^0.25.0",
"markdownlint-rule-search-replace": "^1.2.0",
"mdast-util-gfm": "^3.1.0",
"micromark-extension-gfm": "^3.0.0",
"mkdirp": "^3.0.1",
"mockdate": "^3.0.5",
"nock": "^14.0.11",
"nodemon": "3.1.10",
"ora": "^9.3.0",
"patch-package": "^8.0.1",
"prettier": "^3.8.1",
"rimraf": "^6.1.3",
"sass": "^1.97.3",
"start-server-and-test": "^3.0.0",
"typescript": "^6.0.2",
Expand Down
5 changes: 2 additions & 3 deletions src/audit-logs/lib/deduplicate.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { existsSync } from 'fs'
import { writeFile } from 'fs/promises'
import { mkdirp } from 'mkdirp'
import { mkdir, writeFile } from 'fs/promises'
import path from 'path'

import type {
Expand Down Expand Up @@ -79,7 +78,7 @@ export async function writeDeduplicatedAuditLogData(

const sharedDir = path.join(AUDIT_LOG_DATA_DIR, 'shared')
if (!existsSync(sharedDir)) {
await mkdirp(sharedDir)
await mkdir(sharedDir, { recursive: true })
}

await writeFile(path.join(sharedDir, 'entries.json'), JSON.stringify(entriesPool))
Expand Down
5 changes: 2 additions & 3 deletions src/audit-logs/scripts/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
//
// Requires GITHUB_TOKEN.
import { existsSync } from 'fs'
import { readFile, writeFile } from 'fs/promises'
import { mkdirp } from 'mkdirp'
import { mkdir, readFile, writeFile } from 'fs/promises'
import path from 'path'

import { filterByAllowlistValues, filterAndUpdateGhesDataByAllowlistValues } from '../lib/index'
Expand Down Expand Up @@ -190,7 +189,7 @@ async function main() {
const auditLogVersionDirPath = path.join(AUDIT_LOG_DATA_DIR, version)

if (!existsSync(auditLogVersionDirPath)) {
await mkdirp(auditLogVersionDirPath)
await mkdir(auditLogVersionDirPath, { recursive: true })
}

for (const page of Object.values(AUDIT_LOG_PAGES)) {
Expand Down
8 changes: 3 additions & 5 deletions src/automated-pipelines/lib/update-markdown.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import walk from 'walk-sync'
import { existsSync, lstatSync, unlinkSync } from 'fs'
import path from 'path'
import { readFile, writeFile, readdir } from 'fs/promises'
import { mkdir, rm, readFile, writeFile, readdir } from 'fs/promises'
import matter from '@gr2m/gray-matter'
import { rimraf } from 'rimraf'
import { mkdirp } from 'mkdirp'
import { difference, isEqual } from 'lodash-es'

import { allVersions } from '@/versions/lib/all-versions'
Expand Down Expand Up @@ -212,7 +210,7 @@ async function updateDirectory(
const initialDirectoryListing = await getDirectoryInfo(directory)
if (initialDirectoryListing.directoryContents.length === 0 && !rootDirectoryOnly) {
logger.info('Removing empty directory', { directory })
await rimraf(directory)
await rm(directory, { recursive: true, force: true })
return
}

Expand Down Expand Up @@ -526,7 +524,7 @@ function isRootIndexFile(indexFile: string): boolean {

async function createDirectory(targetDirectory: string): Promise<void> {
if (!existsSync(targetDirectory)) {
await mkdirp(targetDirectory)
await mkdir(targetDirectory, { recursive: true })
}
}

Expand Down
5 changes: 2 additions & 3 deletions src/automated-pipelines/tests/update-markdown.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { tmpdir } from 'os'
import { cp, rm, readFile } from 'fs/promises'
import { existsSync } from 'fs'
import { existsSync, mkdirSync } from 'fs'
import path from 'path'

import { afterAll, beforeAll, describe, expect, test } from 'vitest'
import { mkdirp } from 'mkdirp'
import matter from '@gr2m/gray-matter'
import type { FrontmatterVersions } from '@/types'

Expand Down Expand Up @@ -77,7 +76,7 @@ describe('automated content directory updates', () => {
// structure and contents after running updateContentDirectory.
beforeAll(async () => {
process.env.TEST_OS_ROOT_DIR = tempDirectory
mkdirp.sync(`${tempContentDirectory}`)
mkdirSync(`${tempContentDirectory}`, { recursive: true })
await cp('src/automated-pipelines/tests/fixtures/content', tempContentDirectory, {
recursive: true,
})
Expand Down
8 changes: 3 additions & 5 deletions src/codeql-cli/scripts/sync.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { readFile, writeFile, copyFile } from 'fs/promises'
import { mkdir, rm, readFile, writeFile, copyFile } from 'fs/promises'
import { existsSync } from 'fs'
import walk from 'walk-sync'
import { mkdirp } from 'mkdirp'
import { execFileSync, execSync } from 'child_process'
import path from 'path'
import matter from '@gr2m/gray-matter'
import { rimraf } from 'rimraf'

import { updateContentDirectory } from '../../automated-pipelines/lib/update-markdown'
import { convertContentToDocs } from './convert-markdown-for-docs'
Expand Down Expand Up @@ -72,8 +70,8 @@ async function setupEnvironment() {
)
}

await rimraf(TEMP_DIRECTORY)
await mkdirp(TEMP_DIRECTORY)
await rm(TEMP_DIRECTORY, { recursive: true, force: true })
await mkdir(TEMP_DIRECTORY, { recursive: true })
}

async function rstToMarkdown(rstSourceDirectory: string) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const codeAnnotationCommentSpacing = {
if (restOfLine.startsWith(' ') && restOfLine.length > 1 && restOfLine[1] === ' ') {
const lineNumber: number = token.lineNumber + index + 1
const fixedLine: string = line.replace(
new RegExp(`^(\\s*${commentChar.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')})\\s+`),
new RegExp(`^(\\s*${RegExp.escape(commentChar)})\\s+`),
`$1 `,
)

Expand Down
7 changes: 3 additions & 4 deletions src/content-linter/lib/linting-rules/link-quotation.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { addError, filterTokens } from 'markdownlint-rule-helpers'
import { getRange, quotePrecedesLinkOpen } from '../helpers/utils'
import { escapeRegExp } from 'lodash-es'
import type { RuleParams, RuleErrorCallback, MarkdownToken, Rule } from '../../types'

export const linkQuotation: Rule = {
Expand All @@ -21,11 +20,11 @@ export const linkQuotation: Rule = {
if (child.type === 'link_open' && quotePrecedesLinkOpen(previous_child.content || '')) {
if (!child.attrs) continue
inLinkWithPrecedingQuotes = true
linkUrl = escapeRegExp(child.attrs[0][1])
linkUrl = RegExp.escape(child.attrs[0][1])
} else if (inLinkWithPrecedingQuotes && child.type === 'text') {
content.push(escapeRegExp((child.content || '').trim()))
content.push(RegExp.escape((child.content || '').trim()))
} else if (inLinkWithPrecedingQuotes && child.type === 'code_inline') {
content.push(`\`${escapeRegExp((child.content || '').trim())}\``)
content.push(`\`${RegExp.escape((child.content || '').trim())}\``)
} else if (child.type === 'link_close') {
const title = content.join(' ')
const regex = new RegExp(`"\\[${title}\\]\\(${linkUrl}\\)({%.*%})?(!|\\.|\\?|,)?"`)
Expand Down
Loading
Loading