Skip to content

Commit f1e3c7e

Browse files
authored
Merge pull request #14252 from MicrosoftDocs/ghogen-patch-875777
Implement clean repo workflow for orphaned images
2 parents 3d8ab92 + ef29b6b commit f1e3c7e

File tree

1 file changed

+22
-26
lines changed

1 file changed

+22
-26
lines changed

.github/workflows/clean-repo.yml

Lines changed: 22 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,43 @@
1-
name: "clean repo"
1+
name: "clean repo - images"
22

33
on:
44
schedule:
5-
- cron: "0 1 1 */3 *" # Runs at 01:00, on day 1 of every third month
5+
- cron: "0 1 1 * *" # Runs at 01:00, on day 1 of the month
66
workflow_dispatch:
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
clean-repo:
1013
runs-on: ubuntu-latest
1114
permissions:
1215
contents: write
13-
issues: write
1416
pull-requests: write
1517

1618
steps:
17-
- uses: actions/[email protected]
19+
- name: Harden Runner
20+
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
21+
with:
22+
egress-policy: audit
23+
24+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
1825

1926
# Call clean repo
2027
- name: Clean repo
2128
id: clean-repo-step
22-
uses: dotnet/docs-tools/cleanrepo/CleanRepo@main
29+
uses: dotnet/docs-tools/cleanrepo@main
2330
with:
24-
docfx_directory: '.'
25-
articles_directory: 'docs'
26-
media_directory: 'docs'
27-
snippets_directory: '.' # This includes the ./samples and ./docs directories, which both contain snippets.
28-
includes_directory: 'includes'
29-
url_base_path: '/visualstudio'
30-
delete: true
31-
orphaned_articles: false
32-
orphaned_images: true
33-
catalog_images: false
34-
orphaned_snippets: true
35-
orphaned_includes: false
36-
replace_redirects: true
37-
relative_links: true
38-
remove_hops: true
39-
31+
function: "FindOrphanedImages"
32+
docfx_directory: "."
33+
target_directory: "docs"
34+
url_base_path: "/dotnet"
35+
4036
# Create the PR for the work done by the "clean repo" tool
4137
- name: create-pull-request
42-
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e
38+
uses: dotnet/actions-create-pull-request@v4
4339
with:
44-
branch: create-cleanrepo-pull-request/patch
45-
title: "Monthly chores: Automated repo cleanup"
46-
commit-message: 'Bot 🤖 generated CleanRepo tool run'
47-
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 #..."
40+
branch: cleanrepo-orphaned-images
41+
title: "Monthly chores: Delete orphaned images"
42+
commit-message: "Bot 🤖 generated CleanRepo tool run"
43+
body: "Find and delete orphaned images. Contributes to #..."

0 commit comments

Comments
 (0)