Skip to content

Commit 51aaa68

Browse files
Copilotpkbullock
andcommitted
Replace Git submodules with git clone in workflow
Co-authored-by: pkbullock <[email protected]>
1 parent 42bf12e commit 51aaa68

File tree

4 files changed

+36
-36
lines changed

4 files changed

+36
-36
lines changed

.github/workflows/update-cmdlet-help.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,22 @@ jobs:
1313
pull-requests: write
1414

1515
steps:
16-
- name: Checkout repository with submodules
16+
- name: Checkout repository
1717
uses: actions/checkout@v4
18-
with:
19-
submodules: recursive
20-
fetch-depth: 0
2118

22-
- name: Update submodules to latest
19+
- name: Clone help repositories
2320
run: |
24-
git submodule update --remote --merge
21+
mkdir -p docfx/help-repos
22+
cd docfx/help-repos
23+
24+
# Clone PnP PowerShell documentation
25+
git clone --depth 1 https://github.com/pnp/powershell.git pnp-powershell
26+
27+
# Clone CLI for Microsoft 365 documentation
28+
git clone --depth 1 https://github.com/pnp/cli-microsoft365.git cli-microsoft365
29+
30+
# Clone SharePoint PowerShell documentation
31+
git clone --depth 1 https://github.com/MicrosoftDocs/OfficeDocs-SharePoint-PowerShell.git OfficeDocs-SharePoint-PowerShell
2532
2633
- name: Run Get-HelpJson.ps1
2734
shell: pwsh

.gitmodules

Lines changed: 0 additions & 9 deletions
This file was deleted.

docfx/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
/**/bin/
88
/**/obj/
99
_site
10+
help-repos/

docfx/help-repos/README.md

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ This directory contains automation for updating cmdlet help documentation from e
44

55
## Overview
66

7-
The cmdlet help documentation is automatically synchronized from three upstream repositories using Git submodules:
7+
The cmdlet help documentation is automatically synchronized from three upstream repositories using `git clone`:
88

99
- **PnP PowerShell**: [pnp/powershell](https://github.com/pnp/powershell)
1010
- **CLI for Microsoft 365**: [pnp/cli-microsoft365](https://github.com/pnp/cli-microsoft365)
1111
- **SharePoint Online Management Shell**: [MicrosoftDocs/OfficeDocs-SharePoint-PowerShell](https://github.com/MicrosoftDocs/OfficeDocs-SharePoint-PowerShell)
1212

13-
## Git Submodules
13+
## Directory Structure
1414

15-
The submodules are located in `docfx/help-repos/` directory:
15+
The repositories are cloned into `docfx/help-repos/` directory during the GitHub Action workflow:
1616

1717
```
1818
docfx/help-repos/
@@ -21,40 +21,40 @@ docfx/help-repos/
2121
└── OfficeDocs-SharePoint-PowerShell/
2222
```
2323

24-
### Working with Submodules
25-
26-
To clone the repository with submodules:
27-
```bash
28-
git clone --recurse-submodules https://github.com/pnp/script-samples.git
29-
```
30-
31-
To update submodules to the latest version:
32-
```bash
33-
git submodule update --remote --merge
34-
```
24+
**Note:** The `help-repos/` directory is ignored by Git (via `.gitignore`) and is only created during the automated workflow or manual updates.
3525

3626
## Automation
3727

3828
### Monthly Updates
3929

4030
A GitHub Action workflow (`.github/workflows/update-cmdlet-help.yml`) runs monthly on the 1st day of each month to:
4131

42-
1. Update all submodules to their latest versions
32+
1. Clone the latest versions of all three documentation repositories
4333
2. Run `Get-HelpJson.ps1` to regenerate help JSON files
4434
3. Create a pull request if changes are detected
4535

4636
### Manual Updates
4737

48-
You can manually trigger the workflow from the GitHub Actions tab or run the script locally:
38+
You can manually run the update process locally:
4939

50-
```powershell
51-
cd docfx
52-
./Get-HelpJson.ps1
40+
```bash
41+
# Create the help-repos directory
42+
mkdir -p docfx/help-repos
43+
cd docfx/help-repos
44+
45+
# Clone the repositories
46+
git clone --depth 1 https://github.com/pnp/powershell.git pnp-powershell
47+
git clone --depth 1 https://github.com/pnp/cli-microsoft365.git cli-microsoft365
48+
git clone --depth 1 https://github.com/MicrosoftDocs/OfficeDocs-SharePoint-PowerShell.git OfficeDocs-SharePoint-PowerShell
49+
50+
# Go back to docfx directory and run the script
51+
cd ..
52+
pwsh ./Get-HelpJson.ps1
5353
```
5454

5555
## Get-HelpJson.ps1
5656

57-
This PowerShell script processes the documentation from the submodules and generates JSON files containing cmdlet names and their documentation URLs.
57+
This PowerShell script processes the documentation from the cloned repositories and generates JSON files containing cmdlet names and their documentation URLs.
5858

5959
### Generated Files
6060

@@ -70,5 +70,6 @@ These JSON files are used by the documentation website to provide quick links to
7070

7171
- **Always up-to-date**: Monthly automatic updates ensure documentation links stay current
7272
- **Human review**: All updates go through a PR review process
73-
- **Traceability**: Git submodules track exact versions of upstream documentation
73+
- **No local clutter**: Cloned repositories are not committed to the main repository
74+
- **Simple approach**: Uses standard `git clone` instead of submodules
7475
- **No manual maintenance**: Eliminates the need to manually sync documentation

0 commit comments

Comments
 (0)