Skip to content

Commit

Permalink
Moved the update readme code to a seperate action
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffpatton1971 committed Oct 17, 2024
1 parent d2ed9cd commit f9337a8
Showing 1 changed file with 9 additions and 25 deletions.
34 changes: 9 additions & 25 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,32 +64,16 @@ jobs:
globs: '**/*.md'
fix: true

- name: Run Inline PowerShell Commands
run: |
pwsh -command "
$ProjectName = "${{ vars.PROJECT_NAME }}"
$RootPath = "${{ github.workspace }}"
$GithubOwner = "${{ github.repository_owner }}"
$GithubRepo = "${{ github.repository }}"
$Project = [xml](Get-Content -Path "$($RootPath)/$($ProjectName)/$($ProjectName)");
$PackageId = $Project.Project.PropertyGroup.PackageId;
Write-Host "PAckageId: $($PackageId)"
$readMe = Get-Item -Path "$($RootPath)\README.md"
$TableHeaders = "| Latest Version | Nuget.org | Issues | License | Discord |"
$Columns = "|-----------------|----------------|----------------|----------------|----------------|"
$VersionBadge = "[![Latest Version](https://img.shields.io/github/v/tag/$($GithubOwner)/$($ProjectName))]($($GithubRepo)/$($ProjectName)/tags)"
$IssueBadge = "[![GitHub issues](https://img.shields.io/github/issues/$($GithubOwner)/$($ProjectName))]($($GithubRepo)/$($ProjectName)/issues)"
$LicenseBadge = "[![GitHub license](https://img.shields.io/github/license/$($GithubOwner)/$($ProjectName))]($($GithubRepo)/$($ProjectName)/blob/master/LICENSE)"
$DiscordBadge = "[![Discord Server](https://assets-global.website-files.com/6257adef93867e50d84d30e2/636e0b5493894cf60b300587_full_logo_white_RGB.svg)](https://discord.com/channels/1044305359021555793/1044305781627035811)"
Write-Output $TableHeaders | Out-File $readMe.FullName -Force
Write-Output $Columns | Out-File $readMe.FullName -Append
Write-Output "| $($VersionBadge) | $($GalleryBadge) | $($IssueBadge) | $($LicenseBadge) | $($DiscordBadge) |" | Out-File $readMe.FullName -Append
- name: Update README using custom action
uses: mod-posh/UpdateReadme@main
with:
project_name: "${{ vars.PROJECT_NAME }}"
verbose: true

Get-Content -Path "$($script:Root)\$($ProjectName).md" |Out-File -FilePath $readMe.FullName -Append
"
- name: Download updated README.md artifact
uses: actions/download-artifact@v3
with:
name: updated-readme

- name: Commit Documentation Changes
run: |
Expand Down

0 comments on commit f9337a8

Please sign in to comment.