Skip to content

clean repo

clean repo #35

Workflow file for this run

name: "clean repo"
on:
schedule:
- cron: "0 1 1 * *" # Runs at 01:00, on day 1 of the month
workflow_dispatch:
permissions:
contents: read
jobs:
clean-repo:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
with:
egress-policy: audit
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
# Call clean repo
- name: Clean repo
id: clean-repo-step
uses: dotnet/docs-tools/cleanrepo@2a815a6c0976e888a49264f513dc230008b4a1f2
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: '/dotnet'
delete: true
orphaned_articles: true
orphaned_images: true
catalog_images: false
orphaned_snippets: true
orphaned_includes: true
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@c5a7806660adbe173f04e3e038b0ccdcd758773c
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 #..."