Skip to content

Commit 9bbe193

Browse files
ATAdocs, no monthly, create new branch and switch to it
1 parent 856ff1e commit 9bbe193

File tree

1 file changed

+30
-21
lines changed

1 file changed

+30
-21
lines changed

.github/workflows/cleanrepo.yml

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,68 @@
1-
name: "Clean Repo"
1+
name: Clean Repo
22

33
on:
4-
schedule:
5-
- cron: "0 1 1 * *"
64
workflow_dispatch:
75

8-
permissions:
9-
contents: write
10-
pull-requests: write
11-
126
jobs:
137
clean-repo:
148
runs-on: ubuntu-latest
15-
169
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
1827
1928
- name: Clean orphaned articles
2029
uses: dotnet/docs-tools/cleanrepo@main
2130
with:
2231
function: "FindOrphanedArticles"
23-
docfx_directory: "."
24-
target_directory: "."
32+
docfx_directory: "ATADocs"
33+
target_directory: "ATADocs"
2534
url_base_path: "/dotnet"
2635

2736
- name: Clean orphaned images
2837
uses: dotnet/docs-tools/cleanrepo@main
2938
with:
3039
function: "FindOrphanedImages"
31-
docfx_directory: "."
32-
target_directory: "."
40+
docfx_directory: "ATADocs"
41+
target_directory: "ATADocs"
3342
url_base_path: "/dotnet"
3443

3544
- name: Clean orphaned includes
3645
uses: dotnet/docs-tools/cleanrepo@main
3746
with:
3847
function: "FindOrphanedIncludes"
39-
docfx_directory: "."
40-
target_directory: "."
48+
docfx_directory: "ATADocs"
49+
target_directory: "ATADocs"
4150
url_base_path: "/dotnet"
4251

4352
- name: Clean orphaned snippets
4453
uses: dotnet/docs-tools/cleanrepo@main
4554
with:
4655
function: "FindOrphanedSnippets"
47-
docfx_directory: "."
48-
target_directory: "."
56+
docfx_directory: "ATADocs"
57+
target_directory: "ATADocs"
4958
url_base_path: "/dotnet"
5059

5160
- name: Create pull request
52-
uses: dotnet/actions-create-pull-request@v4
61+
uses: peter-evans/create-pull-request@v5
5362
with:
54-
branch: cleanrepo-orphaned-articles
55-
title: "Monthly chores: Delete orphaned content"
63+
branch: ${{ env.BRANCH }}
64+
title: "Clean Repo ${{ env.BRANCH }}"
5665
commit-message: "Bot 🤖 generated CleanRepo tool run"
5766
body: |
5867
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

Comments
 (0)