diff --git a/.github/workflows/link-check-all.yml b/.github/workflows/link-check-all.yml index 0a5e1cea58..f11f3e2faf 100644 --- a/.github/workflows/link-check-all.yml +++ b/.github/workflows/link-check-all.yml @@ -28,9 +28,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748 - # Get the branches so merge_group can make the comparison with git diff - with: - fetch-depth: 0 - name: Setup node uses: actions/setup-node@17f8bd926464a1afa4c6a11669539e9c1ba77048 @@ -41,38 +38,46 @@ jobs: - name: Install run: npm ci - # Creates file "${{ env.HOME }}/files.json", among others - name: Gather files changed env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} PR: ${{ github.event.pull_request.number }} HEAD: ${{ github.event.pull_request.head.ref || github.event.merge_group.head_ref }} run: | + # Find the file diff in the pull request or merge group # If its a pull request, use the faster call to the GitHub API # For push, workflow_dispatch, and merge_group, use git diff if [ -n "$PR" ] then + echo __ running gh pr diff __ DIFF=`gh pr diff $PR --name-only` elif [ -n "$HEAD" ] then + echo __ running git fetch main __ + git fetch origin main --depth 1 + echo __ running git diff __ DIFF=`git diff --name-only origin/main` else + echo __ no head, empty diff __ DIFF='' fi + # So we can inspect the output + echo __ DIFF found __ + echo $DIFF # Formats into single line JSON array, removing any empty strings - echo $DIFF | tr ' ' '\n' | jq --raw-input | jq --slurp --compact-output 'map(select(length > 0))' > $HOME/files.json - - # For verification - - name: Show files changed - run: cat $HOME/files.json + echo __ format, write to files.json __ + echo $DIFF | \ + tr ' ' '\n' | \ + jq --raw-input | \ + jq --slurp --compact-output 'map(select(length > 0))' \ + > $HOME/files.json - name: Link check (warnings, changed files) env: # Don't care about CDN caching image URLs DISABLE_REWRITE_ASSET_URLS: true run: | - # Note as of Aug 2022, we *don't* check external links # on the pages you touched in the PR. We could enable that # but it has the added risk of false positives blocking CI. diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c8e0be7623..e470a58d20 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -36,7 +36,6 @@ jobs: strategy: fail-fast: false matrix: - # The same array lives in test-windows.yml, so make any updates there too. test-group: [ content, @@ -73,9 +72,9 @@ jobs: # only for the test groups that we know need the files. lfs: ${{ matrix.test-group == 'content' }} # Enables cloning the Early Access repo later with the relevant PAT - persist-credentials: 'false' - # Get the branches so merge_group can make the comparison with git diff - fetch-depth: 0 + # persist-credentials: 'false' + # ->> Do we really need this? actions/checkout doesn't use it for the nested example: + # https://github.com/actions/checkout#checkout-multiple-repos-nested - name: Figure out which docs-early-access branch to checkout, if internal repo if: ${{ github.repository == 'github/docs-internal' }} @@ -135,21 +134,31 @@ jobs: PR: ${{ github.event.pull_request.number }} HEAD: ${{ github.event.pull_request.head.ref || github.event.merge_group.head_ref }} run: | + # Find the file diff in the pull request or merge group # If its a pull request, use the faster call to the GitHub API # For push, workflow_dispatch, and merge_group, use git diff if [ -n "$PR" ] then + echo __ running gh pr diff __ DIFF=`gh pr diff $PR --name-only` elif [ -n "$HEAD" ] then + echo __ running git fetch main __ + git fetch origin main --depth 1 + echo __ running git diff __ DIFF=`git diff --name-only origin/main` else + echo __ no head, empty diff __ DIFF='' fi + # So we can inspect the output + echo __ DIFF found __ + echo $DIFF # So that becomes a string like `foo.js path/bar.md` # Must to do this because the list of files can be HUGE. Especially # in a repo-sync when there are lots of translation files involved. + echo __ format, write to get_diff_files.txt __ echo $DIFF | tr '\n' ' ' > get_diff_files.txt - name: Setup node diff --git a/components/parameter-table/ChildBodyParametersRows.module.scss b/components/parameter-table/ChildBodyParametersRows.module.scss new file mode 100644 index 0000000000..dd2631c562 --- /dev/null +++ b/components/parameter-table/ChildBodyParametersRows.module.scss @@ -0,0 +1,21 @@ +.childBodyParametersRows { + details tr { + border-top: none; + } + + // Remove any default markdown article padding for property cells + details tr td { + padding-bottom: 0.25rem; + } + + // Set the left border for in the nested property tables. Also need to override + // a default markdown file style that sets a table's font size based on + // percentage which would cause the table font size to shrink more and more + // as the properties nested more and more. + td { + table { + border-left: 4px solid var(--color-border-muted); + font-size: inherit !important; + } + } +} diff --git a/components/rest/ChildBodyParametersRows.tsx b/components/parameter-table/ChildBodyParametersRows.tsx similarity index 63% rename from components/rest/ChildBodyParametersRows.tsx rename to components/parameter-table/ChildBodyParametersRows.tsx index 959fb45ed5..6684846f4b 100644 --- a/components/rest/ChildBodyParametersRows.tsx +++ b/components/parameter-table/ChildBodyParametersRows.tsx @@ -1,7 +1,11 @@ +import cx from 'classnames' + import { useTranslation } from 'components/hooks/useTranslation' import { ParameterRow } from './ParameterRow' import type { ChildParameter } from './types' +import styles from './ChildBodyParametersRows.module.scss' + type Props = { slug: string childParamsGroups: ChildParameter[] @@ -15,27 +19,23 @@ export function ChildBodyParametersRows({ parentType, childParamsGroups, }: Props) { - const { t } = useTranslation('products') + const { t } = useTranslation(['parameter_table', 'products']) return ( -
{parentName}
- {parentType}
-
+ | - {`${t('rest.reference.name')}, ${t('rest.reference.type')}, ${t( - 'rest.reference.description' - )}`} - | +{`${t('name')}, ${t('type')}, ${t('description')}`} |
|---|---|
|
+ 0 && isChild ? 'pt-3 border-top color-border-muted' : ''}`
+ )}
+ >
+
+
+
+
+ {rowParams.name}
+ {rowParams.type}
+ {rowParams.isRequired ? (
+ {t('required')}
+ ) : null}
+
+
+ {numPreviews > 0 && (
+
+ {numPreviews > 1 ? ` ${t('see_preview_notices')}` : ` ${t('see_preview_notice')}`}
+
+ )}
+
+
+ {rowParams.default && (
+
+
+ {t('default')}:
+
+ {rowParams.enum.length > 1 ? (
+ <>
+ {t('enum_description_title')}:
+ {rowParams.enum.map((item, index, array) => (
+
+ |
+
| - {t('rest.reference.headers')} + {t('headers')} | |
|---|---|
| - {`${t('rest.reference.name')}, ${t('rest.reference.type')}, ${t( - 'rest.reference.description' - )}`} - | +{`${t('name')}, ${t('type')}, ${t('description')}`} |
| - {t('rest.reference.path')} + {t('path')} | |
| - {`${t('rest.reference.name')}, ${t('rest.reference.type')}, ${t( - 'rest.reference.description' - )}`} - | +{`${t('name')}, ${t('type')}, ${t('description')}`} |
| - {t('rest.reference.query')} + {t('query')} | |
| - {`${t('rest.reference.name')}, ${t('rest.reference.type')}, ${t( - 'rest.reference.description' - )}`} - | +{`${t('name')}, ${t('type')}, ${t('description')}`} |
| - {t('rest.reference.body')} + {t('body')} | |
| - {`${t('rest.reference.name')}, ${t('rest.reference.type')}, ${t( - 'rest.reference.description' - )}`} - | +{`${t('name')}, ${t('type')}, ${t('description')}`} |
|
-
-
-
- {rowParams.name}
- {rowParams.type}
- {rowParams.isRequired ? (
-
- {t('rest.reference.required')}
-
- ) : null}
-
-
- {numPreviews > 0 && (
-
- {numPreviews > 1
- ? ` ${t('rest.reference.see_preview_notices')}`
- : ` ${t('rest.reference.see_preview_notice')}`}
-
- )}
-
-
- {rowParams.default && (
-
-
- {t('rest.reference.default')}:
-
- {t('rest.reference.enum_description_title')}:
-
- {rowParams.enum.map((item, index, array) => {
- return index !== array.length - 1 ? (
-
- |
-