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