|
1 |
| -name: "Clean Repo" |
| 1 | +name: Clean Repo |
2 | 2 |
|
3 | 3 | on:
|
4 |
| - schedule: |
5 |
| - - cron: "0 1 1 * *" |
6 | 4 | workflow_dispatch:
|
7 | 5 |
|
8 |
| -permissions: |
9 |
| - contents: write |
10 |
| - pull-requests: write |
11 |
| - |
12 | 6 | jobs:
|
13 | 7 | clean-repo:
|
14 | 8 | runs-on: ubuntu-latest
|
15 |
| - |
16 | 9 | steps:
|
17 |
| - - uses: actions/checkout@v5 |
| 10 | + - name: Checkout repository |
| 11 | + uses: actions/checkout@v3 |
| 12 | + with: |
| 13 | + fetch-depth: 0 |
| 14 | + |
| 15 | + - name: Set up Git |
| 16 | + run: | |
| 17 | + git config --global user.name "github-actions" |
| 18 | + git config --global user.email "[email protected]" |
| 19 | +
|
| 20 | + - name: Generate unique branch name |
| 21 | + run: echo "BRANCH=cleanrepo-$(date +'%Y%m%d-%H%M')" >> $GITHUB_ENV |
| 22 | + |
| 23 | + - name: Create and switch to new branch |
| 24 | + run: | |
| 25 | + git checkout -b $BRANCH |
| 26 | + git push origin $BRANCH |
18 | 27 |
|
19 | 28 | - name: Clean orphaned articles
|
20 | 29 | uses: dotnet/docs-tools/cleanrepo@main
|
21 | 30 | with:
|
22 | 31 | function: "FindOrphanedArticles"
|
23 |
| - docfx_directory: "." |
24 |
| - target_directory: "." |
| 32 | + docfx_directory: "ATADocs" |
| 33 | + target_directory: "ATADocs" |
25 | 34 | url_base_path: "/dotnet"
|
26 | 35 |
|
27 | 36 | - name: Clean orphaned images
|
28 | 37 | uses: dotnet/docs-tools/cleanrepo@main
|
29 | 38 | with:
|
30 | 39 | function: "FindOrphanedImages"
|
31 |
| - docfx_directory: "." |
32 |
| - target_directory: "." |
| 40 | + docfx_directory: "ATADocs" |
| 41 | + target_directory: "ATADocs" |
33 | 42 | url_base_path: "/dotnet"
|
34 | 43 |
|
35 | 44 | - name: Clean orphaned includes
|
36 | 45 | uses: dotnet/docs-tools/cleanrepo@main
|
37 | 46 | with:
|
38 | 47 | function: "FindOrphanedIncludes"
|
39 |
| - docfx_directory: "." |
40 |
| - target_directory: "." |
| 48 | + docfx_directory: "ATADocs" |
| 49 | + target_directory: "ATADocs" |
41 | 50 | url_base_path: "/dotnet"
|
42 | 51 |
|
43 | 52 | - name: Clean orphaned snippets
|
44 | 53 | uses: dotnet/docs-tools/cleanrepo@main
|
45 | 54 | with:
|
46 | 55 | function: "FindOrphanedSnippets"
|
47 |
| - docfx_directory: "." |
48 |
| - target_directory: "." |
| 56 | + docfx_directory: "ATADocs" |
| 57 | + target_directory: "ATADocs" |
49 | 58 | url_base_path: "/dotnet"
|
50 | 59 |
|
51 | 60 | - name: Create pull request
|
52 |
| - uses: dotnet/actions-create-pull-request@v4 |
| 61 | + uses: peter-evans/create-pull-request@v5 |
53 | 62 | with:
|
54 |
| - branch: cleanrepo-orphaned-articles |
55 |
| - title: "Monthly chores: Delete orphaned content" |
| 63 | + branch: ${{ env.BRANCH }} |
| 64 | + title: "Clean Repo ${{ env.BRANCH }}" |
56 | 65 | commit-message: "Bot 🤖 generated CleanRepo tool run"
|
57 | 66 | body: |
|
58 | 67 | This PR was generated by the Clean Repo GitHub Action.
|
59 |
| - It includes automated cleanup of orphaned content across the entire repo. |
| 68 | + It includes automated cleanup of orphaned content in the ATADocs folder. |
0 commit comments