Skip to content

Commit

Permalink
Merge pull request github#35034 from github/repo-sync
Browse files Browse the repository at this point in the history
Repo sync
  • Loading branch information
docs-bot authored Oct 21, 2024
2 parents 2c02eb5 + f335417 commit cc8f1fa
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/orphaned-files-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ permissions:
contents: read

jobs:
orphaned-assets-check:
orphaned-files-check:
if: ${{ github.repository == 'github/docs-internal' }}
runs-on: ubuntu-latest
steps:
Expand Down
13 changes: 10 additions & 3 deletions src/content-render/scripts/reusables-cli/find/unused.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,17 @@ export function findUnused({ absolute }: { absolute: boolean }) {
const liquidTokens = getLiquidTokens(fileContents)
for (const token of liquidTokens) {
const { args, name } = token
if (name === 'data' && args.startsWith('reusables.')) {
const reusableName = path.join('data', ...args.split('.')) + '.md'
if (
(name === 'data' || name === 'indented_data_reference') &&
args.startsWith('reusables.')
) {
const reusableName = path.join('data', ...args.split(' ')[0].split('.')) + '.md'
// Special cases where we don't want them to count as reusables. It's an example in a how-to doc
if (reusableName.includes('foo/bar.md') || reusableName.includes('your-reusable-name.md')) {
if (
reusableName.includes('foo/bar.md') ||
reusableName.includes('foo/par.md') ||
reusableName.includes('your-reusable-name.md')
) {
continue
}
const reusablePath = resolveReusablePath(reusableName)
Expand Down
1 change: 1 addition & 0 deletions src/content-render/scripts/reusables-cli/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ export function getAllReusablesFilePaths(): string[] {
walk(reusablesDirectory, {
includeBasePath: true,
directories: false,
ignore: ['**/README.md', 'enterprise_deprecation/**'],
}),
)
}
Expand Down

0 comments on commit cc8f1fa

Please sign in to comment.