Skip to content

Commit 221eede

Browse files
Back to gold standard. changed branch and pr title name.
1 parent 9bbe193 commit 221eede

File tree

1 file changed

+25
-28
lines changed

1 file changed

+25
-28
lines changed

.github/workflows/cleanrepo.yml

Lines changed: 25 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,65 @@
1-
name: Clean Repo
1+
name: "clean repo - ATADocs"
22

33
on:
4+
schedule:
5+
- cron: "0 1 1 * *" # Runs at 01:00, on day 1 of the month
46
workflow_dispatch:
57

8+
permissions:
9+
contents: read
10+
611
jobs:
712
clean-repo:
813
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
1417

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:
2219

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
2721

28-
- name: Clean orphaned articles
22+
# Find orphaned articles
23+
- name: Clean repo - orphaned articles
2924
uses: dotnet/docs-tools/cleanrepo@main
3025
with:
3126
function: "FindOrphanedArticles"
3227
docfx_directory: "ATADocs"
3328
target_directory: "ATADocs"
3429
url_base_path: "/dotnet"
3530

36-
- name: Clean orphaned images
31+
# Find orphaned images
32+
- name: Clean repo - orphaned images
3733
uses: dotnet/docs-tools/cleanrepo@main
3834
with:
3935
function: "FindOrphanedImages"
4036
docfx_directory: "ATADocs"
4137
target_directory: "ATADocs"
4238
url_base_path: "/dotnet"
4339

44-
- name: Clean orphaned includes
40+
# Find orphaned includes
41+
- name: Clean repo - orphaned includes
4542
uses: dotnet/docs-tools/cleanrepo@main
4643
with:
4744
function: "FindOrphanedIncludes"
4845
docfx_directory: "ATADocs"
4946
target_directory: "ATADocs"
5047
url_base_path: "/dotnet"
5148

52-
- name: Clean orphaned snippets
49+
# Find orphaned snippets
50+
- name: Clean repo - orphaned snippets
5351
uses: dotnet/docs-tools/cleanrepo@main
5452
with:
5553
function: "FindOrphanedSnippets"
5654
docfx_directory: "ATADocs"
5755
target_directory: "ATADocs"
5856
url_base_path: "/dotnet"
5957

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
6261
with:
63-
branch: ${{ env.BRANCH }}
64-
title: "Clean Repo ${{ env.BRANCH }}"
62+
branch: cleanrepo-orphaned-articles-01
63+
title: "Clean Repo: Delete orphaned content"
6564
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

Comments
 (0)