|
| 1 | + |
| 2 | +name: "clean repo - ATADocs" |
| 3 | + |
| 4 | +on: |
| 5 | + schedule: |
| 6 | + - cron: "0 1 1 * *" # Runs at 01:00, on day 1 of the month |
| 7 | + workflow_dispatch: |
| 8 | + |
| 9 | +permissions: |
| 10 | + contents: read |
| 11 | + |
| 12 | +jobs: |
| 13 | + clean-repo: |
| 14 | + runs-on: ubuntu-latest |
| 15 | + permissions: |
| 16 | + contents: write |
| 17 | + pull-requests: write |
| 18 | + |
| 19 | + steps: |
| 20 | + |
| 21 | + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 |
| 22 | + |
| 23 | + # Find orphaned articles |
| 24 | + - name: Clean repo - orphaned articles |
| 25 | + uses: dotnet/docs-tools/cleanrepo@main |
| 26 | + with: |
| 27 | + function: "FindOrphanedArticles" |
| 28 | + docfx_directory: "ATADocs" |
| 29 | + target_directory: "ATADocs" |
| 30 | + url_base_path: "/dotnet" |
| 31 | + |
| 32 | + # Find orphaned images |
| 33 | + - name: Clean repo - orphaned images |
| 34 | + uses: dotnet/docs-tools/cleanrepo@main |
| 35 | + with: |
| 36 | + function: "FindOrphanedImages" |
| 37 | + docfx_directory: "ATADocs" |
| 38 | + target_directory: "ATADocs" |
| 39 | + url_base_path: "/dotnet" |
| 40 | + |
| 41 | + # Find orphaned includes |
| 42 | + - name: Clean repo - orphaned includes |
| 43 | + uses: dotnet/docs-tools/cleanrepo@main |
| 44 | + with: |
| 45 | + function: "FindOrphanedIncludes" |
| 46 | + docfx_directory: "ATADocs" |
| 47 | + target_directory: "ATADocs" |
| 48 | + url_base_path: "/dotnet" |
| 49 | + |
| 50 | + # Find orphaned snippets |
| 51 | + - name: Clean repo - orphaned snippets |
| 52 | + uses: dotnet/docs-tools/cleanrepo@main |
| 53 | + with: |
| 54 | + function: "FindOrphanedSnippets" |
| 55 | + docfx_directory: "ATADocs" |
| 56 | + target_directory: "ATADocs" |
| 57 | + url_base_path: "/dotnet" |
| 58 | + |
| 59 | + # Create the PR for the work done by the "clean repo" tool |
| 60 | + - name: create-pull-request |
| 61 | + uses: dotnet/actions-create-pull-request@v4 |
| 62 | + with: |
| 63 | + branch: cleanrepo-orphaned-articles |
| 64 | + title: "Monthly chores: Delete orphaned articles" |
| 65 | + commit-message: "Bot 🤖 generated CleanRepo tool run" |
| 66 | + body: "Find and delete orphaned articles. Contributes to #..." |
0 commit comments