Skip to content

Commit 317d784

Browse files
🩹 [Patch]: Add JSON logging for Host and PSStyle contexts (#12)
## Description This pull request introduces several updates to automation and logging in the repository, focusing on dependency management and workflow maintenance, along with improvements to script documentation and output formatting. **Automation and Dependency Management** * Added a new `.github/dependabot.yml` configuration to enable weekly updates for GitHub Actions dependencies using Dependabot. **Workflow Maintenance** * Updated all GitHub Actions workflows (`Action-Test.yml`, `Auto-Release.yml`, and `Linter.yml`) to use `actions/checkout@v5` for improved reliability and security. [[1]](diffhunk://#diff-a12ae5c885b0673c0ff6f70c2670886907590d624626e07da4c52e01aeaf56a4L32-R32) [[2]](diffhunk://#diff-d3f6900ee5159d4bc4ba6d893e2dd8443c2691b0490d7351cffbd7a37ed8d95aL28-R29) [[3]](diffhunk://#diff-482e65806ed9e4a7320f14964764086b91fed4a28d12e4efde1776472e147e79L22-R22) **Script Documentation and Output Improvements** * Revised example values in `Set-MaskedValue` documentation within `scripts/Helpers.psm1` to use generic token placeholders instead of actual token formats, enhancing security and clarity. [[1]](diffhunk://#diff-acb1351e3ba396afa6a397b0bd44b5d8ed3ffeb97a3f3ef3633e9cfd6cacf11aL15-R15) [[2]](diffhunk://#diff-acb1351e3ba396afa6a397b0bd44b5d8ed3ffeb97a3f3ef3633e9cfd6cacf11aL25-R25) * Enhanced logging in `scripts/main.ps1` by adding new log groups that output `Host` and `PSStyle` information in JSON format for easier parsing and debugging. [[1]](diffhunk://#diff-dc2e5a659836b1b73abb03421c567f5018c2755677c4a0aa764cb26117b68011R133-R136) [[2]](diffhunk://#diff-dc2e5a659836b1b73abb03421c567f5018c2755677c4a0aa764cb26117b68011R152-R155) ## Type of change <!-- Use the check-boxes [x] on the options that are relevant. --> - [ ] 📖 [Docs] - [ ] 🪲 [Fix] - [x] 🩹 [Patch] - [ ] ⚠️ [Security fix] - [ ] 🚀 [Feature] - [ ] 🌟 [Breaking change] ## Checklist <!-- Use the check-boxes [x] on the options that are relevant. --> - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas
1 parent 746c946 commit 317d784

File tree

6 files changed

+25
-6
lines changed

6 files changed

+25
-6
lines changed

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: github-actions # See documentation for possible values
9+
directory: / # Location of package manifests
10+
schedule:
11+
interval: weekly

.github/workflows/Action-Test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
steps:
3030
# Need to check out as part of the test, as its a local action
3131
- name: Checkout repo
32-
uses: actions/checkout@v4
32+
uses: actions/checkout@v5
3333

3434
- name: Action-Test
3535
uses: ./

.github/workflows/Auto-Release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ jobs:
2525
Auto-Release:
2626
runs-on: ubuntu-latest
2727
steps:
28-
- name: Checkout Code
29-
uses: actions/checkout@v4
28+
- name: Checkout repo
29+
uses: actions/checkout@v5
3030

3131
- name: Auto-Release
3232
uses: PSModule/Auto-Release@v1

.github/workflows/Linter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- name: Checkout repo
22-
uses: actions/checkout@v4
22+
uses: actions/checkout@v5
2323
with:
2424
fetch-depth: 0
2525

scripts/Helpers.psm1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
If no match is found, the original value is returned unaltered.
1313
1414
.EXAMPLE
15-
Set-MaskedValue -Value 'github_pat_1234567890123456789012'
15+
Set-MaskedValue -Value '<a token starting with github_pat_>'
1616
1717
Output:
1818
```powershell
@@ -22,7 +22,7 @@
2222
Masks a GitHub fine-grained personal access token.
2323
2424
.EXAMPLE
25-
Set-MaskedValue -Value 'ghp_abcdefghijklmnopqrstuvwxyz0123456789' #gitleaks:allow
25+
Set-MaskedValue -Value '<a token starting with ghp_>'
2626
2727
Output:
2828
```powershell

scripts/main.ps1

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,10 @@ LogGroup 'Host' {
130130
$Host | Select-Object * | Format-List | Out-String
131131
}
132132

133+
LogGroup 'Host - Json' {
134+
$Host | ConvertTo-Json -Depth 3
135+
}
136+
133137
LogGroup 'MyInvocation' {
134138
$MyInvocation | Select-Object * | Format-List | Out-String
135139
}
@@ -145,3 +149,7 @@ LogGroup 'PSSessionOption' {
145149
LogGroup 'PSStyle' {
146150
$PSStyle | Select-Object * | Format-List | Out-String
147151
}
152+
153+
LogGroup 'PSStyle - Json' {
154+
$PSStyle | ConvertTo-Json -Depth 3
155+
}

0 commit comments

Comments
 (0)