|
1 | | -name: "clean repo" |
| 1 | +name: "clean repo - images" |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | 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 |
6 | 6 | workflow_dispatch: |
7 | 7 |
|
| 8 | +permissions: |
| 9 | + contents: read |
| 10 | + |
8 | 11 | jobs: |
9 | 12 | clean-repo: |
10 | 13 | runs-on: ubuntu-latest |
11 | 14 | permissions: |
12 | 15 | contents: write |
13 | | - issues: write |
14 | 16 | pull-requests: write |
15 | 17 |
|
16 | 18 | steps: |
17 | | - |
| 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 |
18 | 25 |
|
19 | 26 | # Call clean repo |
20 | 27 | - name: Clean repo |
21 | 28 | id: clean-repo-step |
22 | | - uses: dotnet/docs-tools/cleanrepo/CleanRepo@main |
| 29 | + uses: dotnet/docs-tools/cleanrepo@main |
23 | 30 | 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: "docs" |
| 33 | + target_directory: "docs" |
| 34 | + url_base_path: "/visualstudio" |
| 35 | + |
40 | 36 | # Create the PR for the work done by the "clean repo" tool |
41 | 37 | - name: create-pull-request |
42 | | - uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e |
| 38 | + uses: dotnet/actions-create-pull-request@v4 |
43 | 39 | 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