Skip to content

Commit 663d831

Browse files
📖 [Docs]: Update scripts README documentation (#159)
Updates the scripts README with improved accuracy, missing details, and markdown style consistency. The documentation now fully reflects the current behavior of the font data updater, including branch cleanup for superseded PRs. - Fixes #158 ## Branch cleanup documentation Added missing documentation about branch deletion for superseded PRs. The `Update-FontsData.ps1` script deletes branches associated with closed superseded PRs, which was previously undocumented. ## Markdown style fixes - Fixed line wrapping to comply with the 80-120 character guideline - Added blank lines before and after fenced code blocks per markdown conventions - Improved readability of long paragraphs by breaking at natural phrase boundaries
1 parent 1fb4aba commit 663d831

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

scripts/README.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ This directory contains scripts for automating the maintenance of the GoogleFont
44

55
## Update-FontsData.ps1
66

7-
This script automatically updates the `src/FontsData.json` file with the latest font metadata from Google Fonts API.
7+
This script automatically updates the `src/FontsData.json` file with the latest font metadata from
8+
Google Fonts API.
89

910
### Features
1011

@@ -24,6 +25,7 @@ This script automatically updates the `src/FontsData.json` file with the latest
2425
5. **PR Supersedence**: After creating a new PR, the script:
2526
- Searches for existing open PRs with titles matching `Auto-Update*` (excluding the newly created PR)
2627
- Closes each superseded PR with a comment referencing the new PR number
28+
- Deletes the branches associated with superseded PRs
2729
- Ensures only the latest update PR remains open
2830

2931
### PR Lifecycle Management
@@ -33,20 +35,25 @@ The font data updater implements PR supersedence similar to Dependabot. When a n
3335
- The script first creates the new PR
3436
- Then checks for existing open `Auto-Update*` PRs (excluding the newly created one)
3537
- Each existing PR receives a comment referencing the new PR number:
38+
3639
```text
3740
This PR has been superseded by #[NEW_PR_NUMBER] and will be closed automatically.
3841
3942
The font data has been updated in the newer PR. Please refer to #[NEW_PR_NUMBER] for the most current changes.
4043
```
44+
4145
- All superseded PRs are automatically closed
46+
- Branches for closed PRs are deleted
4247

43-
This means there is no need for a separate cleanup workflow on merge — by the time a PR is merged, it is already the only open Auto-Update PR.
48+
This means there is no need for a separate cleanup workflow on merge — by the time a PR is merged,
49+
it is already the only open Auto-Update PR.
4450

4551
### Workflow
4652

4753
#### Update-FontsData.yml
4854

4955
Handles the scheduled updates, PR creation, and supersedence:
56+
5057
- **Trigger**: Daily at midnight UTC, or manual via `workflow_dispatch`
5158
- **Authentication**: Uses GitHub App credentials for API access
5259
- **Permissions**: Requires secrets:
@@ -65,8 +72,8 @@ You can manually trigger an update using the GitHub Actions UI:
6572

6673
### Configuration
6774

68-
The supersedence behavior is built into the script and requires no additional configuration. The message posted when closing superseded PRs can be
69-
customized by modifying `scripts/Update-FontsData.ps1`.
75+
The supersedence behavior is built into the script and requires no additional configuration. The message
76+
posted when closing superseded PRs can be customized by modifying `scripts/Update-FontsData.ps1`.
7077

7178
### Development
7279

@@ -76,7 +83,8 @@ To test changes to the update script:
7683
2. Modify `scripts/Update-FontsData.ps1`
7784
3. Push the branch
7885
4. Manually trigger the workflow on your feature branch
79-
5. The script will detect it's running on a feature branch and update the existing branch instead of creating a new PR
86+
5. The script will detect it's running on a feature branch and update the existing branch instead of
87+
creating a new PR
8088

8189
### Troubleshooting
8290

0 commit comments

Comments
 (0)