clean repo #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "clean repo" | |
on: | |
schedule: | |
- cron: "0 1 1 */3 *" # Runs at 01:00, on day 1 of every third month | |
workflow_dispatch: | |
jobs: | |
clean-repo: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
issues: write | |
pull-requests: write | |
steps: | |
- uses: actions/[email protected] | |
# Call clean repo | |
- name: Clean repo | |
id: clean-repo-step | |
uses: dotnet/docs-tools/cleanrepo/CleanRepo@main | |
with: | |
docfx_directory: '.' | |
articles_directory: 'docs' | |
media_directory: 'docs' | |
snippets_directory: '.' # This includes the ./samples and ./docs directories, which both contain snippets. | |
includes_directory: 'includes' | |
url_base_path: '/visualstudio' | |
delete: true | |
orphaned_articles: false | |
orphaned_images: true | |
catalog_images: false | |
orphaned_snippets: true | |
orphaned_includes: false | |
replace_redirects: true | |
relative_links: true | |
remove_hops: true | |
# Create the PR for the work done by the "clean repo" tool | |
- name: create-pull-request | |
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f | |
with: | |
branch: create-cleanrepo-pull-request/patch | |
title: "Monthly chores: Automated repo cleanup" | |
commit-message: 'Bot 🤖 generated CleanRepo tool run' | |
body: "Find and delete orphaned articles, images, snippets, and include files. Remove redirection hops, update redirected links in articles, and replace site-relative links with file-relative links. Contributes to #..." |