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
3 changes: 2 additions & 1 deletion content/rest/orgs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ children:
- /orgs
- /outside-collaborators
- /personal-access-tokens
- /rules
- /properties
- /rule-suites
- /rules
- /security-managers
- /webhooks
autogenerated: rest
Expand Down
20 changes: 20 additions & 0 deletions content/rest/orgs/properties.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
title: Properties
shortTitle: Properties
intro: 'Use the REST API to create and manage custom properties for an organization. You can use custom properties to define a group of repositories.'
versions: # DO NOT MANUALLY EDIT. CHANGES WILL BE OVERWRITTEN BY A 🤖
fpt: '*'
ghec: '*'
topics:
- API
autogenerated: rest
allowTitleToDifferFromFilename: true
---

{% note %}

**Note:** The API endpoints for custom properties are in public beta and subject to change.

{% endnote %}

<!-- Content after this section is automatically generated -->
3 changes: 2 additions & 1 deletion content/rest/repos/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ children:
- /contents
- /forks
- /lfs
- /properties
- /repos
- /rules
- /rule-suites
- /rules
- /tags
autogenerated: rest
---
Expand Down
20 changes: 20 additions & 0 deletions content/rest/repos/properties.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
title: Properties
shortTitle: Properties
intro: 'Use the REST API to list the custom properties assigned to a repository by the organization.'
versions: # DO NOT MANUALLY EDIT. CHANGES WILL BE OVERWRITTEN BY A 🤖
fpt: '*'
ghec: '*'
topics:
- API
autogenerated: rest
allowTitleToDifferFromFilename: true
---

{% note %}

**Note:** The API endpoints for custom properties are in public beta and subject to change.

{% endnote %}

<!-- Content after this section is automatically generated -->
73 changes: 2 additions & 71 deletions src/content-linter/tests/lint-files.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import walk from 'walk-sync'
import { zip } from 'lodash-es'
import yaml from 'js-yaml'
import fs from 'fs/promises'
import { existsSync } from 'fs'
import { jest } from '@jest/globals'

import languages from '#src/languages/lib/languages.js'
Expand All @@ -16,8 +15,6 @@ jest.useFakeTimers({ legacyFakeTimers: true })
const __dirname = path.dirname(fileURLToPath(import.meta.url))

const rootDir = path.join(__dirname, '../../..')
const contentDir = path.join(rootDir, 'content')
const reusablesDir = path.join(rootDir, 'data/reusables')
const variablesDir = path.join(rootDir, 'data/variables')
const glossariesDir = path.join(rootDir, 'data/glossaries')
const fbvDir = path.join(rootDir, 'data/features')
Expand Down Expand Up @@ -162,13 +159,6 @@ const oldVariableErrorText =
const oldOcticonErrorText =
'Found octicon variables with the old {{ octicon-name }} syntax. Use {% octicon "name" %} instead!'

const mdWalkOptions = {
globs: ['**/*.md'],
ignore: ['**/README.md'],
directories: false,
includeBasePath: true,
}

// Also test the "data/variables/" YAML files

const yamlWalkOptions = {
Expand All @@ -178,68 +168,10 @@ const yamlWalkOptions = {
}

// different lint rules apply to different content types
let mdToLint, ymlToLint
let ymlToLint

// compile lists of all the files we want to lint

const contentMarkdownAbsPaths = walk(contentDir, mdWalkOptions).sort()
const contentMarkdownRelPaths = contentMarkdownAbsPaths.map((p) => slash(path.relative(rootDir, p)))

// Get the list of config files for automated pipelines
const automatedConfigFiles = walk(`src`, { includeBasePath: true, globs: ['**/lib/config.json'] })
// Get a list of Markdown files to ignore during Markdown linting
const automatedIgnorePaths = (
await Promise.all(
automatedConfigFiles.map(async (p) => {
return JSON.parse(await fs.readFile(p, 'utf8')).linterIgnore || []
}),
)
)
.flat()
.filter(Boolean)

// For each linterIgnore directory, walk the files in the directory and add
// to the ignore list.
const ignoreMarkdownFilesAbsPath = new Set(
automatedIgnorePaths
.filter((p) => {
const exists = existsSync(p)
if (!exists) {
console.warn(
`WARNING: Ignored path ${p} defined in an automation pipeline does not exist. This may be expected, but if not, remove the defined path from the pipeline config.`,
)
}
return exists
})
.map((p) =>
walk(p, {
includeBasePath: true,
globs: ['**/*.md'],
}),
)
.flat(),
)

// Difference between contentMarkdownAbsPaths & automatedIgnorePaths
const contentMarkdownNoAutomated = [...contentMarkdownRelPaths].filter(
(p) => !ignoreMarkdownFilesAbsPath.has(p),
)
// We also need to go back and get the difference between the
// absolute paths list
const contentMarkdownAbsPathNoAutomated = [...contentMarkdownAbsPaths].filter(
(p) => !ignoreMarkdownFilesAbsPath.has(slash(path.relative(rootDir, p))),
)

const contentMarkdownTuples = zip(contentMarkdownNoAutomated, contentMarkdownAbsPathNoAutomated)

const reusableMarkdownAbsPaths = walk(reusablesDir, mdWalkOptions).sort()
const reusableMarkdownRelPaths = reusableMarkdownAbsPaths.map((p) =>
slash(path.relative(rootDir, p)),
)
const reusableMarkdownTuples = zip(reusableMarkdownRelPaths, reusableMarkdownAbsPaths)

mdToLint = [...contentMarkdownTuples, ...reusableMarkdownTuples]

// data/variables
const variableYamlAbsPaths = walk(variablesDir, yamlWalkOptions).sort()
const variableYamlRelPaths = variableYamlAbsPaths.map((p) => slash(path.relative(rootDir, p)))
Expand Down Expand Up @@ -296,11 +228,10 @@ if (diffFiles.length > 0) {
tuples.filter(
([relativePath, absolutePath]) => only.has(relativePath) || only.has(absolutePath),
)
mdToLint = filterFiles(mdToLint)
ymlToLint = filterFiles(ymlToLint)
}

if (mdToLint.length + ymlToLint.length < 1) {
if (ymlToLint.length === 0) {
// With this in place, at least one `test()` is called and you don't
// get the `Your test suite must contain at least one test.` error
// from `jest`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,42 @@
"additional-permissions": [],
"access": "write"
},
{
"category": "orgs",
"slug": "create-or-update-custom-properties-for-an-organization",
"subcategory": "properties",
"verb": "patch",
"requestPath": "/orgs/{org}/properties/schema",
"additional-permissions": [],
"access": "write"
},
{
"category": "orgs",
"slug": "create-or-update-a-custom-property-for-an-organization",
"subcategory": "properties",
"verb": "put",
"requestPath": "/orgs/{org}/properties/schema/{custom_property_name}",
"additional-permissions": [],
"access": "write"
},
{
"category": "orgs",
"slug": "remove-a-custom-property-for-an-organization",
"subcategory": "properties",
"verb": "delete",
"requestPath": "/orgs/{org}/properties/schema/{custom_property_name}",
"additional-permissions": [],
"access": "write"
},
{
"category": "orgs",
"slug": "create-or-update-custom-property-values-for-organization-repositories",
"subcategory": "properties",
"verb": "patch",
"requestPath": "/orgs/{org}/properties/values",
"additional-permissions": [],
"access": "write"
},
{
"category": "orgs",
"slug": "get-all-organization-repository-rulesets",
Expand Down Expand Up @@ -535,6 +571,33 @@
"additional-permissions": [],
"access": "write"
},
{
"category": "orgs",
"slug": "get-all-custom-properties-for-an-organization",
"subcategory": "properties",
"verb": "get",
"requestPath": "/orgs/{org}/properties/schema",
"additional-permissions": [],
"access": "read"
},
{
"category": "orgs",
"slug": "get-a-custom-property-for-an-organization",
"subcategory": "properties",
"verb": "get",
"requestPath": "/orgs/{org}/properties/schema/{custom_property_name}",
"additional-permissions": [],
"access": "read"
},
{
"category": "orgs",
"slug": "list-custom-property-values-for-organization-repositories",
"subcategory": "properties",
"verb": "get",
"requestPath": "/orgs/{org}/properties/values",
"additional-permissions": [],
"access": "read"
},
{
"category": "orgs",
"slug": "list-public-organization-members",
Expand Down Expand Up @@ -2808,6 +2871,15 @@
"additional-permissions": [],
"access": "write"
},
{
"category": "repos",
"slug": "get-all-custom-property-values-for-a-repository",
"subcategory": "properties",
"verb": "get",
"requestPath": "/repos/{owner}/{repo}/properties/values",
"additional-permissions": [],
"access": "read"
},
{
"category": "repos",
"slug": "create-a-repository-ruleset",
Expand Down
48 changes: 48 additions & 0 deletions src/github-apps/data/fpt-2022-11-28/fine-grained-pat.json
Original file line number Diff line number Diff line change
Expand Up @@ -2972,6 +2972,48 @@
"verb": "delete",
"requestPath": "/orgs/{org}/outside_collaborators/{username}"
},
{
"slug": "get-all-custom-properties-for-an-organization",
"subcategory": "properties",
"verb": "get",
"requestPath": "/orgs/{org}/properties/schema"
},
{
"slug": "create-or-update-custom-properties-for-an-organization",
"subcategory": "properties",
"verb": "patch",
"requestPath": "/orgs/{org}/properties/schema"
},
{
"slug": "get-a-custom-property-for-an-organization",
"subcategory": "properties",
"verb": "get",
"requestPath": "/orgs/{org}/properties/schema/{custom_property_name}"
},
{
"slug": "create-or-update-a-custom-property-for-an-organization",
"subcategory": "properties",
"verb": "put",
"requestPath": "/orgs/{org}/properties/schema/{custom_property_name}"
},
{
"slug": "remove-a-custom-property-for-an-organization",
"subcategory": "properties",
"verb": "delete",
"requestPath": "/orgs/{org}/properties/schema/{custom_property_name}"
},
{
"slug": "list-custom-property-values-for-organization-repositories",
"subcategory": "properties",
"verb": "get",
"requestPath": "/orgs/{org}/properties/values"
},
{
"slug": "create-or-update-custom-property-values-for-organization-repositories",
"subcategory": "properties",
"verb": "patch",
"requestPath": "/orgs/{org}/properties/values"
},
{
"slug": "list-public-organization-members",
"subcategory": "members",
Expand Down Expand Up @@ -3892,6 +3934,12 @@
"verb": "delete",
"requestPath": "/repos/{owner}/{repo}/private-vulnerability-reporting"
},
{
"slug": "get-all-custom-property-values-for-a-repository",
"subcategory": "properties",
"verb": "get",
"requestPath": "/repos/{owner}/{repo}/properties/values"
},
{
"slug": "get-rules-for-a-branch",
"subcategory": "rules",
Expand Down
Loading