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
2 changes: 1 addition & 1 deletion .github/workflows/check-broken-links-github-github.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
# need to use a token from a user with access to github/github for this step
GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_BASE }}
REPORT_AUTHOR: docs-bot
REPORT_LABEL: github github broken link report
REPORT_LABEL: github github broken link report,workflow-generated
REPORT_REPOSITORY: github/docs-content
steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/copy-api-issue-to-internal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:

- name: Create an issue in the docs-content repo
run: |
new_issue_url="$(gh issue create --title "$ISSUE_TITLE" --body "$ISSUE_BODY" --repo github/docs-content)"
new_issue_url="$(gh issue create --title "$ISSUE_TITLE" --body "$ISSUE_BODY" --repo github/docs-content --label "workflow-generated")"
echo 'NEW_ISSUE='$new_issue_url >> $GITHUB_ENV
env:
GITHUB_TOKEN: ${{secrets.DOCS_BOT_PAT_BASE}}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/delete-orphan-translation-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ jobs:
--body '👋 humans. This PR was generated from docs-internal/.github/workflows/delete-orphan-translation-files.yml.
' \
--repo "${{ matrix.language_repo }}" \
--label "workflow-generated" \
--head=$branch_name
echo "Merge created PR..."
retry_command gh pr merge --merge --auto --delete-branch "$branch_name"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/generate-code-scanning-query-lists.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ jobs:
gh pr create \
--title "Update CodeQL query tables" \
--repo github/docs-internal \
--label "codeql-query-tables,skip FR board,ready-for-doc-review" \
--label "codeql-query-tables,skip FR board,ready-for-doc-review,workflow-generated" \
--body '👋 humans. This PR updates the **CodeQL query table reusables** with the latest changes in preparation for the next **CodeQL CLI** release.

No action is required from the first responder for the Docs content team. This PR will be reviewed and merged by the Code scanning and GHAS focus team as part of the next release of CodeQL CLI. (Synced from codeql@${{ steps.codeql.outputs.OPENAPI_COMMIT_SHA }})
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/moda-allowed-ips.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ jobs:
gh pr create \
--title "Update list of allowed IPs" \
--body 'This PR updates the list of allowed IPs in Moda. It is automatically generated.' \
--label "workflow-generated" \
--head=$branchname
echo "Pull request created"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/orphaned-features-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ jobs:
--title "Delete orphaned features ($date)" \
--body "$body" \
--repo github/docs-internal \
--label docs-content-fr
--label docs-content-fr,workflow-generated

- uses: ./.github/actions/slack-alert
if: ${{ failure() && github.event_name == 'schedule' }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/orphaned-files-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ jobs:
--title "Delete orphaned files ($date)" \
--body "$body" \
--repo github/docs-internal \
--label docs-content-fr
--label docs-content-fr,workflow-generated

- uses: ./.github/actions/slack-alert
if: ${{ failure() && github.event_name == 'schedule' }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sme-review-tracking-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,5 @@ jobs:
- Reviewer stating they'll need to get back to us at a later time
- Review provided was unclear or missing key information, and a follow-up is necessary
`,
labels: ['on track','open source', 'sme-review'],
labels: ['on track','open source', 'sme-review', 'workflow-generated'],
});
2 changes: 1 addition & 1 deletion .github/workflows/sync-audit-logs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:
Make sure the PR builds successfully and there are no gross errors (for example, a file is deleted). You do not need to validate the contents (that is the responsibility of product teams).
If CI does not pass or other problems arise, contact #docs-engineering on slack.' \
--repo github/docs-internal \
--label audit-log-pipeline \
--label audit-log-pipeline,workflow-generated \
--head=$branchname
echo "Created pull request"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sync-codeql-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ jobs:

If CI does not pass or other problems arise, contact #docs-engineering on slack.' \
--repo github/docs-internal \
--label "codeql-cli-pipeline,skip FR board,ready-for-doc-review"
--label "codeql-cli-pipeline,skip FR board,ready-for-doc-review,workflow-generated"

- uses: ./.github/actions/slack-alert
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sync-openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ jobs:

If CI does not pass or other problems arise, contact #docs-engineering on slack.' \
--repo github/docs-internal \
--label github-openapi-bot \
--label github-openapi-bot,workflow-generated \
--head=$branchname \

- uses: ./.github/actions/slack-alert
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sync-secret-scanning.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:

If CI does not pass or other problems arise, contact #docs-engineering on Slack.' \
--repo github/docs-internal \
--label secret-scanning-pipeline,'skip FR board',ready-for-doc-review \
--label secret-scanning-pipeline,'skip FR board',ready-for-doc-review,workflow-generated \
--head=$branchname

- uses: ./.github/actions/slack-alert
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ Some linting rules return warnings or errors based on HTML comments that you can

#### Syntax for expiring and expired content

Rules `GHD038` and `GHD039` check for content that has been manually given an expiration date. Fourteen days before the specified date, the content linter will return a warning that the content is expiring soon. Starting on the specified date, the content linter will return an error and flag the content for remediation.
Rules `GHD038` and `GHD039` check for content that has been manually given an expiration date. Fourteen days before the specified date, the content linter will return a warning that the content is expiring soon. Starting on the specified date, the content linter will return a warning and flag the content for remediation.

You can add an expiration date to content by wrapping it in HTML tags that contain an expiration date in the format: `<!-- expires yyyy-mm-dd --> <!-- end expires yyyy-mm-dd -->`

Expand Down
2 changes: 1 addition & 1 deletion data/reusables/contributing/content-linter-rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
| GHD022 | liquid-ifversion-versions | Liquid `ifversion`, `elsif`, and `else` tags should be valid and not contain unsupported versions. | error | liquid, versioning |
| GHD035 | rai-reusable-usage | RAI articles and reusables can only reference reusable content in the data/reusables/rai directory | error | feature, rai |
| GHD036 | image-no-gif | Image must not be a gif, styleguide reference: contributing/style-guide-and-content-model/style-guide.md#images | error | images |
| GHD038 | expired-content | Expired content must be remediated. | error | expired |
| GHD038 | expired-content | Expired content must be remediated. | warning | expired |
| GHD039 | expiring-soon | Content that expires soon should be proactively addressed. | warning | expired |
| [GHD040](https://github.com/github/docs/blob/main/src/content-linter/README.md) | table-liquid-versioning | Tables must use the correct liquid versioning format | error | tables |
| GHD041 | third-party-action-pinning | Code examples that use third-party actions must always pin to a full length commit SHA | error | feature, actions |
Expand Down
2 changes: 1 addition & 1 deletion src/content-linter/style/github-docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ const githubDocsConfig = {
},
'expired-content': {
// GHD038
severity: 'error',
severity: 'warning',
'partial-markdown-files': true,
},
'expiring-soon': {
Expand Down
29 changes: 1 addition & 28 deletions src/content-linter/tests/category-pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ describe.skip('category pages', () => {
let publishedArticlePaths: string[] = []
let availableArticlePaths: string[] = []
let categoryVersions: string[] = []
let categoryChildTypes: string[] = []

let allowTitleToDifferFromFilename: boolean | undefined = false
let indexTitle: string = ''
let indexShortTitle: string = ''
Expand All @@ -101,23 +101,9 @@ describe.skip('category pages', () => {
const data = parsed.data as MarkdownFrontmatter
categoryVersions = getApplicableVersions(data.versions, indexAbsPath)
allowTitleToDifferFromFilename = data.allowTitleToDifferFromFilename
categoryChildTypes = []
const articleLinks = data.children.filter((child) => {
const mdPath = getPath(productDir, indexLink, child)

const fileExists = fs.existsSync(mdPath)

// We're checking each item in the category's 'children' frontmatter
// to see if the child is an article by tacking on `.md` to it. If
// that file exists it's an article, otherwise it's a map topic. A
// category needs to have all the same type of children so we track
// that here so we can test to make sure all the types are the same.
if (fileExists) {
categoryChildTypes.push('article')
} else {
categoryChildTypes.push('mapTopic')
}

return fileExists && fs.statSync(mdPath).isFile()
})

Expand Down Expand Up @@ -217,19 +203,6 @@ describe.skip('category pages', () => {
})
})

test('categories contain all the same type of children', () => {
let errorType = ''
expect(
categoryChildTypes.every((categoryChildType) => {
errorType = categoryChildType
return categoryChildType === categoryChildTypes[0]
}),
`${indexRelPath.replace('index.md', '')} contains a mix of ${errorType}s and ${
categoryChildTypes[0]
}s, category children must be of the same type`,
).toBe(true)
})

test('slugified title matches parent directory name', () => {
if (allowTitleToDifferFromFilename) return

Expand Down
1 change: 1 addition & 0 deletions src/ghes-releases/lib/deprecation-steps.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ labels:
- enterprise deprecation
- priority-1
- time sensitive
- workflow-generated
---

# Deprecation steps for GHES releases
Expand Down
2 changes: 1 addition & 1 deletion src/ghes-releases/lib/release-templates/release-steps-0.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ labels:
- skip FR board
- GHES {{ release-number }}
- ghes-release-automation
- rhythm of docs operations
- workflow-generated
---

This issue tracks Docs work for the GA release of GHES {{ release-number }}.
Expand Down
1 change: 1 addition & 0 deletions src/ghes-releases/lib/release-templates/release-steps-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ labels:
- skip FR board
- rhythm of docs operations
- GHES {{ release-number }}
- workflow-generated
---

## Instructions for triage
Expand Down
1 change: 1 addition & 0 deletions src/ghes-releases/lib/release-templates/release-steps-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ labels:
- skip FR board
- GHES {{ release-number }}
- rhythm of docs operations
- workflow-generated
---

## Instructions for triage
Expand Down
1 change: 1 addition & 0 deletions src/ghes-releases/lib/release-templates/release-steps-3.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ labels:
- new-release
- priority-0
- GHES {{ release-number }}
- workflow-generated
---

Docs Content will publish docs for the GHES {{ release-number }} RC soon. Please draft a release note for the latest supported version of the CodeQL CLI, and update the docs to reflect the latest supported version.
Expand Down
1 change: 1 addition & 0 deletions src/ghes-releases/lib/release-templates/release-steps-4.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ labels:
- Enterprise
- priority-0
- skip FR board
- workflow-generated
---

Docs Content will publish docs for the GHES {{ release-number }} RC soon. Please update the docs to reflect the minimum required version of the Actions Runner application for the new release.
Expand Down
1 change: 1 addition & 0 deletions src/ghes-releases/lib/release-templates/release-steps-5.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ labels:
- priority-0
- skip FR board
- rhythm of docs operations
- workflow-generated
---

## Instructions for triage
Expand Down
4 changes: 2 additions & 2 deletions src/release-notes/middleware/ghes-release-notes.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { NextFunction, Response } from 'express'

import { formatReleases, renderPatchNotes } from '@/release-notes/lib/release-notes-utils'
import { all } from '@/versions/lib/enterprise-server-releases.js'
import { all, latestStable } from '@/versions/lib/enterprise-server-releases.js'
import { executeWithFallback } from '@/languages/lib/render-with-fallback.js'
import { getReleaseNotes } from './get-release-notes'
import type { Context, ExtendedRequest } from '@/types'
Expand Down Expand Up @@ -87,7 +87,7 @@ export default async function ghesReleaseNotesContext(
// GHES release notes on docs started with 2.20 but older release notes exist on enterprise.github.com.
// So we want to use _all_ GHES versions when calculating next and previous releases.
req.context.latestPatch = req.context.ghesReleaseNotes![0].version
req.context.latestRelease = all[0]
req.context.latestRelease = latestStable

// Add convenience props for "Supported releases" section on GHES Admin landing page (NOT release notes).
req.context.ghesReleases.forEach((release) => {
Expand Down
23 changes: 22 additions & 1 deletion src/release-notes/tests/yaml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { beforeAll, describe, expect, test } from 'vitest'
import yaml from 'js-yaml'

import { liquid } from '@/content-render/index.js'
import { getDataByLanguage } from '@/data-directory/lib/get-data.js'
import { allVersions } from '@/versions/lib/all-versions.js'

interface ReleaseNoteContent {
intro: string
Expand Down Expand Up @@ -34,7 +36,7 @@ describe('lint enterprise release notes', () => {
yamlContent = yaml.load(fileContents) as ReleaseNoteContent
})

test('contains valid liquid', () => {
test('contains valid liquid', async () => {
const { intro, sections } = yamlContent
let toLint: Record<string, string> = { intro }
for (const key in sections) {
Expand All @@ -54,9 +56,28 @@ describe('lint enterprise release notes', () => {
})
}

// Create context with site data for rendering liquid variables
const context = {
currentLanguage: 'en',
currentVersionObj: allVersions['free-pro-team@latest'],
site: {
data: {
reusables: getDataByLanguage('reusables', 'en'),
variables: getDataByLanguage('variables', 'en'),
ui: getDataByLanguage('ui', 'en'),
},
},
}

for (const key in toLint) {
if (!toLint[key]) continue
// First check if liquid parses correctly
expect(() => liquid.parse(toLint[key]), `${key} contains invalid liquid`).not.toThrow()
// Then check if liquid renders correctly with context
await expect(
liquid.parseAndRender(toLint[key], context),
`${key} contains liquid that fails to render`,
).resolves.not.toThrow()
}
})

Expand Down
Loading
Loading