Skip to content

clean repo - snippets #4

clean repo - snippets

clean repo - snippets #4

name: "clean repo - snippets"
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@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
# Call clean repo
- name: Clean repo
id: clean-repo-step
uses: dotnet/docs-tools/cleanrepo@main
with:
function: "FindOrphanedSnippets"
docfx_directory: "."
target_directory: "docs"
url_base_path: "/dotnet"
# Create the PR for the work done by the "clean repo" tool
- name: create-pull-request
uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f
with:
branch: cleanrepo-orphaned-snippets
title: "Monthly chores: Delete orphaned snippets"
commit-message: "Bot 🤖 generated CleanRepo tool run"
body: "Find and delete orphaned snippets. Contributes to #..."