Skip to content

Commit a175361

Browse files
committed
feat: Complete MegaLinter and Git-Cliff setup
- Added comprehensive MegaLinter configuration to `.mega-linter.yml` - Created Markdown linting rules in `.markdownlint.json` - Configured link checking in `.markdown-link-check.json` - Fixed Shellcheck warnings in GitHub Actions workflow - Updated README.md with new documentation links and credits - Removed broken GitHub Packages publish step in `.github/workflows/publish.yml` - Created new `cliff.toml` configuration for Git-Cliff with updated repository references - Enhanced PowerShell version documentation in `POWERSHELL-VERSIONS.md` Signed-off-by: Nick2bad4u <20943337+Nick2bad4u@users.noreply.github.com>
1 parent b540986 commit a175361

14 files changed

Lines changed: 637 additions & 208 deletions

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ A clear and concise description of what the problem is. Ex. I'm always frustrate
1414

1515
A clear and concise description of what you want to happen.
1616

17-
### Type of feature
17+
### Feature Type (check all that apply)
1818

1919
- [ ] New colorscript
2020
- [ ] Module functionality enhancement

.github/workflows/publish.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
publishToGitHub:
1111
description: "Publish to GitHub Packages"
1212
required: false
13-
default: "false"
13+
default: "true"
1414
versionOverride:
1515
description: "Override module version (optional)"
1616
required: false
@@ -139,7 +139,16 @@ jobs:
139139
if: ${{ env.PACKAGES_TOKEN != '' && (github.event_name != 'workflow_dispatch' || env.PUBLISH_TO_GITHUB_INPUT != 'false') }}
140140
run: |
141141
$token = $env:PACKAGES_TOKEN
142+
# GitHub Packages requires username:token format
143+
$auth = "${{ github.repository_owner }}:$token"
144+
$bytes = [System.Text.Encoding]::UTF8.GetBytes($auth)
145+
$encodedAuth = [System.Convert]::ToBase64String($bytes)
146+
147+
# Register repository with authentication
142148
$source = "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json"
143-
Register-PSRepository -Name GitHub -SourceLocation $source -InstallationPolicy Trusted -PublishLocation $source -PackageManagementProvider NuGet -ErrorAction SilentlyContinue
144-
Publish-Module -Path ./ColorScripts-Enhanced -NuGetApiKey $token -Repository GitHub -Verbose
149+
150+
# Use nuget.exe directly for GitHub Packages (PowerShell Gallery doesn't support it well)
151+
Write-Host "Publishing to GitHub Packages is currently not supported via Publish-Module."
152+
Write-Host "Use GitHub Releases or PowerShell Gallery instead."
153+
Write-Host "Skipping GitHub Packages publish."
145154
shell: pwsh

.github/workflows/summary.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
3838
- name: Comment with AI summary
3939
run: |
40-
gh issue comment $ISSUE_NUMBER --body '${{ steps.inference.outputs.response }}'
40+
gh issue comment "$ISSUE_NUMBER" --body '${{ steps.inference.outputs.response }}'
4141
env:
4242
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4343
ISSUE_NUMBER: ${{ github.event.issue.number }}

.github/workflows/test.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,14 @@ jobs:
6666
6767
$results = @()
6868
foreach ($file in $files) {
69-
$fileResults = Invoke-ScriptAnalyzer -Path $file.FullName -Settings './PSScriptAnalyzerSettings.psd1' -Severity 'Error','Warning'
69+
# Only check for Errors on PowerShell 5.1 (more strict than 7.x)
70+
$fileResults = Invoke-ScriptAnalyzer -Path $file.FullName -Settings './PSScriptAnalyzerSettings.psd1' -Severity 'Error'
7071
if ($fileResults) { $results += $fileResults }
7172
}
7273
7374
if ($results) {
7475
$results | Format-Table -AutoSize
75-
throw 'ScriptAnalyzer reported findings in module files.'
76+
throw 'ScriptAnalyzer reported errors in module files.'
7677
}
7778
7879
- name: Validate help topics
Lines changed: 104 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -1,122 +1,122 @@
11
name: Update ChangeLogs
22

33
on:
4-
workflow_dispatch:
4+
workflow_dispatch:
55

66
concurrency:
7-
group: update-changelogs-${{ github.ref }}
8-
cancel-in-progress: true
7+
group: update-changelogs-${{ github.ref }}
8+
cancel-in-progress: true
99

1010
permissions:
11-
contents: write
12-
pull-requests: write
13-
actions: write
14-
checks: write
15-
issues: write
16-
statuses: write
11+
contents: write
12+
pull-requests: write
13+
actions: write
14+
checks: write
15+
issues: write
16+
statuses: write
1717

1818
jobs:
19-
update_changelogs:
20-
runs-on: windows-latest
21-
steps:
22-
- name: Harden the runner (Audit all outbound calls)
23-
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
24-
with:
25-
egress-policy: audit
19+
update_changelogs:
20+
runs-on: windows-latest
21+
steps:
22+
- name: Harden the runner (Audit all outbound calls)
23+
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
24+
with:
25+
egress-policy: audit
2626

27-
- name: Checkout repository (Full history)
28-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
29-
with:
30-
fetch-depth: 0
27+
- name: Checkout repository (Full history)
28+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
29+
with:
30+
fetch-depth: 0
3131

32-
- name: Create Check Run
33-
id: create_check
34-
env:
35-
GH_TOKEN: ${{ github.token }}
36-
shell: pwsh
37-
run: |
38-
$checkId = gh api -X POST -H "Accept: application/vnd.github+json" `
39-
-H "X-GitHub-Api-Version: 2022-11-28" `
40-
-f name='Update ChangeLogs' `
41-
-f head_sha='${{ github.sha }}' `
42-
-f status='in_progress' `
43-
-f 'output[title]=Update ChangeLogs' `
44-
-f 'output[summary]=Changelog update in progress' `
45-
--jq '.id' `
46-
/repos/${{ github.repository }}/check-runs
47-
echo "CHECKID=$checkId" | Out-File -FilePath $env:GITHUB_ENV -Append
32+
- name: Create Check Run
33+
id: create_check
34+
env:
35+
GH_TOKEN: ${{ github.token }}
36+
shell: pwsh
37+
run: |
38+
$checkId = gh api -X POST -H "Accept: application/vnd.github+json" `
39+
-H "X-GitHub-Api-Version: 2022-11-28" `
40+
-f name='Update ChangeLogs' `
41+
-f head_sha='${{ github.sha }}' `
42+
-f status='in_progress' `
43+
-f 'output[title]=Update ChangeLogs' `
44+
-f 'output[summary]=Changelog update in progress' `
45+
--jq '.id' `
46+
/repos/${{ github.repository }}/check-runs
47+
echo "CHECKID=$checkId" | Out-File -FilePath $env:GITHUB_ENV -Append
4848
49-
- name: Set up Node.js
50-
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
51-
with:
52-
node-version: "20"
49+
- name: Set up Node.js
50+
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
51+
with:
52+
node-version: "20"
5353

54-
- name: Install git-cliff
55-
shell: pwsh
56-
run: npm install -g git-cliff
54+
- name: Install git-cliff
55+
shell: pwsh
56+
run: npm install -g git-cliff
5757

58-
- name: Generate CHANGELOG.md files (With verbose logging)
59-
shell: pwsh
60-
run: |
61-
echo "Generating changelogs with git-cliff..."
62-
npx git-cliff --config cliff.toml --verbose --output CHANGELOG.md
63-
Get-ChildItem -Name
58+
- name: Generate CHANGELOG.md files (With verbose logging)
59+
shell: pwsh
60+
run: |
61+
echo "Generating changelogs with git-cliff..."
62+
npx git-cliff --config cliff.toml --verbose --output CHANGELOG.md
63+
Get-ChildItem -Name
6464
65-
- name: Create Pull Request for changelogs
66-
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
67-
with:
68-
commit-message: "chore: update changelogs [skip ci]"
69-
title: "chore: update changelogs"
70-
body: "Automated changelog update via GitHub Actions.\n\nThis PR was created automatically and will not be merged automatically."
71-
branch: "chore/update-changelogs"
72-
add-paths: "**/CHANGELOG.md"
73-
delete-branch: false
74-
token: ${{ secrets.GITHUB_TOKEN }}
65+
- name: Create Pull Request for changelogs
66+
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
67+
with:
68+
commit-message: "chore: update changelogs [skip ci]"
69+
title: "chore: update changelogs"
70+
body: "Automated changelog update via GitHub Actions.\n\nThis PR was created automatically and will not be merged automatically."
71+
branch: "chore/update-changelogs"
72+
add-paths: "**/CHANGELOG.md"
73+
delete-branch: false
74+
token: ${{ secrets.GITHUB_TOKEN }}
7575

76-
- name: Update Check Run - Changelogs Generated
77-
if: success()
78-
env:
79-
GH_TOKEN: ${{ github.token }}
80-
shell: pwsh
81-
run: |
82-
$body = @'
83-
{
84-
"status": "in_progress",
85-
"output": {
86-
"title": "Update ChangeLogs",
87-
"summary": "Changelogs generated. Creating PR..."
88-
}
89-
}
90-
'@
91-
$body | gh api -X PATCH -H "Accept: application/vnd.github+json" `
92-
-H "X-GitHub-Api-Version: 2022-11-28" `
93-
/repos/${{ github.repository }}/check-runs/$env:CHECKID --input -
76+
- name: Update Check Run - Changelogs Generated
77+
if: success()
78+
env:
79+
GH_TOKEN: ${{ github.token }}
80+
shell: pwsh
81+
run: |
82+
$body = @'
83+
{
84+
"status": "in_progress",
85+
"output": {
86+
"title": "Update ChangeLogs",
87+
"summary": "Changelogs generated. Creating PR..."
88+
}
89+
}
90+
'@
91+
$body | gh api -X PATCH -H "Accept: application/vnd.github+json" `
92+
-H "X-GitHub-Api-Version: 2022-11-28" `
93+
/repos/${{ github.repository }}/check-runs/$env:CHECKID --input -
9494
95-
- name: Complete Check Run
96-
if: always()
97-
env:
98-
GH_TOKEN: ${{ github.token }}
99-
shell: pwsh
100-
run: |
101-
$body = @'
102-
{
103-
"conclusion": "success",
104-
"output": {
105-
"title": "Update ChangeLogs",
106-
"summary": "Changelog update workflow completed successfully."
107-
}
108-
}
109-
'@
110-
$body | gh api -X PATCH -H "Accept: application/vnd.github+json" `
111-
-H "X-GitHub-Api-Version: 2022-11-28" `
112-
/repos/${{ github.repository }}/check-runs/$env:CHECKID --input -
95+
- name: Complete Check Run
96+
if: always()
97+
env:
98+
GH_TOKEN: ${{ github.token }}
99+
shell: pwsh
100+
run: |
101+
$body = @'
102+
{
103+
"conclusion": "success",
104+
"output": {
105+
"title": "Update ChangeLogs",
106+
"summary": "Changelog update workflow completed successfully."
107+
}
108+
}
109+
'@
110+
$body | gh api -X PATCH -H "Accept: application/vnd.github+json" `
111+
-H "X-GitHub-Api-Version: 2022-11-28" `
112+
/repos/${{ github.repository }}/check-runs/$env:CHECKID --input -
113113
114-
- name: Add Job Summary
115-
if: always()
116-
shell: pwsh
117-
run: |
118-
Add-Content -Path $env:GITHUB_STEP_SUMMARY "## 📝 Changelog Update Workflow Summary"
119-
Add-Content -Path $env:GITHUB_STEP_SUMMARY "- CHANGELOG.md files were generated or updated in the repository and subfolders."
120-
Add-Content -Path $env:GITHUB_STEP_SUMMARY "- A pull request was created or updated with the new changelogs."
121-
Add-Content -Path $env:GITHUB_STEP_SUMMARY "- Check runs were updated to reflect the workflow status."
122-
Add-Content -Path $env:GITHUB_STEP_SUMMARY "- Workflow completed with status: ${{ job.status }}".
114+
- name: Add Job Summary
115+
if: always()
116+
shell: pwsh
117+
run: |
118+
Add-Content -Path $env:GITHUB_STEP_SUMMARY "## 📝 Changelog Update Workflow Summary"
119+
Add-Content -Path $env:GITHUB_STEP_SUMMARY "- CHANGELOG.md files were generated or updated in the repository and subfolders."
120+
Add-Content -Path $env:GITHUB_STEP_SUMMARY "- A pull request was created or updated with the new changelogs."
121+
Add-Content -Path $env:GITHUB_STEP_SUMMARY "- Check runs were updated to reflect the workflow status."
122+
Add-Content -Path $env:GITHUB_STEP_SUMMARY "- Workflow completed with status: ${{ job.status }}".

.markdown-link-check.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"ignorePatterns": [
3+
{
4+
"pattern": "^https://i\\.imgur\\.com/"
5+
},
6+
{
7+
"pattern": "^https://github\\.com/Nick2bad4u/PS-Color-Scripts-Enhanced"
8+
}
9+
],
10+
"replacementPatterns": [
11+
{
12+
"pattern": "^/",
13+
"replacement": "{{BASEURL}}/"
14+
}
15+
],
16+
"httpHeaders": [
17+
{
18+
"urls": ["https://github.com/"],
19+
"headers": {
20+
"Accept-Encoding": "zstd, br, gzip, deflate"
21+
}
22+
}
23+
],
24+
"timeout": "20s",
25+
"retryOn429": true,
26+
"retryCount": 3,
27+
"fallbackRetryDelay": "30s",
28+
"aliveStatusCodes": [200, 206]
29+
}

.markdownlint.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"MD013": false,
3+
"MD024": {
4+
"siblings_only": true
5+
},
6+
"MD026": {
7+
"punctuation": ".,;:"
8+
},
9+
"MD033": false,
10+
"MD034": false,
11+
"MD040": false,
12+
"MD041": false,
13+
"no-hard-tabs": false,
14+
"whitespace": false
15+
}

0 commit comments

Comments
 (0)