Commit 6ed199f
🩹 [Patch]: Switch to use
## Description
This pull request introduces significant updates to the workflow and
script for automating Google Fonts data updates. Key changes include
enhancements to permissions in the GitHub Actions workflow, improved
repository management in the PowerShell script, and refactoring for
better logging and error handling.
### Workflow Updates:
*
[`.github/workflows/Update-FontsData.yml`](diffhunk://#diff-5c6d6ac6744e613c22fe7a4b5bf6b9fbd4b3bf5548239191e4400a4b17440826L8-R10):
Updated permissions to include `contents: write` and `pull-requests:
write`, enabling the workflow to create pull requests and write changes
to the repository.
*
[`.github/workflows/Update-FontsData.yml`](diffhunk://#diff-5c6d6ac6744e613c22fe7a4b5bf6b9fbd4b3bf5548239191e4400a4b17440826R20-L26):
Added `fetch-depth: 0` to the checkout step to ensure complete history
is fetched, supporting branch operations. Removed unused `ClientID` and
`PrivateKey` inputs from the `Update-FontsData` job.
### Script Enhancements:
*
[`scripts/Update-FontsData.ps1`](diffhunk://#diff-69d235ffacf154789a70d5e00a557ee83393c256cd9431a8b7be57cc41c3ad89L1-R129):
Introduced the `Invoke-NativeCommand` function to standardize execution
of native commands with improved error handling and logging.
*
[`scripts/Update-FontsData.ps1`](diffhunk://#diff-69d235ffacf154789a70d5e00a557ee83393c256cd9431a8b7be57cc41c3ad89L1-R129):
Refactored branch management logic to dynamically determine whether to
create a new branch or use the current branch, ensuring compatibility
with different workflow triggers.
*
[`scripts/Update-FontsData.ps1`](diffhunk://#diff-69d235ffacf154789a70d5e00a557ee83393c256cd9431a8b7be57cc41c3ad89L1-R129):
Improved logging for changes detection, commit creation, and push
operations. Added detailed output for diffs and commit logs to enhance
debugging and visibility.
## Type of change
<!-- Use the check-boxes [x] on the options that are relevant. -->
- [ ] 📖 [Docs]
- [ ] 🪲 [Fix]
- [x] 🩹 [Patch]
- [ ] GITHUB_TOKEN for updates (#68)1 parent 48cc86b commit 6ed199f
2 files changed
Lines changed: 96 additions & 46 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
| |||
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
| 20 | + | |
18 | 21 | | |
19 | 22 | | |
20 | 23 | | |
21 | 24 | | |
22 | 25 | | |
23 | 26 | | |
24 | 27 | | |
25 | | - | |
26 | | - | |
27 | 28 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
2 | 18 | | |
3 | | - | |
4 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
5 | 39 | | |
6 | | - | |
7 | 40 | | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
26 | 68 | | |
27 | 69 | | |
| 70 | + | |
| 71 | + | |
28 | 72 | | |
29 | 73 | | |
30 | | - | |
31 | 74 | | |
32 | 75 | | |
33 | | - | |
34 | | - | |
35 | 76 | | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
51 | 102 | | |
52 | 103 | | |
53 | 104 | | |
54 | | - | |
55 | | - | |
56 | | - | |
| 105 | + | |
57 | 106 | | |
0 commit comments