|
|
@ -32,12 +32,37 @@ jobs: |
|
|
echo "CODE_LINES=$Summary" >> $env:GITHUB_ENV |
|
|
echo "CODE_LINES=$Summary" >> $env:GITHUB_ENV |
|
|
|
|
|
|
|
|
- name: Writing to Gist |
|
|
- name: Writing to Gist |
|
|
uses: schneegans/dynamic-badges-action@master |
|
|
env: |
|
|
with: |
|
|
GIST_TOKEN: ${{ secrets.GIST_SophiaScript_Lines }} |
|
|
auth: ${{ secrets.GIST_SophiaScript }} |
|
|
shell: pwsh |
|
|
gistID: 9852d6b9569a91bf69ceba8a94cc97f4 |
|
|
run: | |
|
|
filename: SophiaScript.json |
|
|
# https://gist.github.com/farag2/9852d6b9569a91bf69ceba8a94cc97f4 |
|
|
label: Lines of Code |
|
|
|
|
|
message: ${{ env.CODE_LINES }} |
|
|
$GistContent = @{ |
|
|
namedLogo: PowerShell |
|
|
schemaVersion = 1 |
|
|
color: brightgreen |
|
|
label = "Lines of Code" |
|
|
|
|
|
message = $env:CODE_LINES |
|
|
|
|
|
color = "brightgreen" |
|
|
|
|
|
namedLogo = "PowerShell" |
|
|
|
|
|
} | ConvertTo-Json |
|
|
|
|
|
|
|
|
|
|
|
$Body = @{ |
|
|
|
|
|
files = @{ |
|
|
|
|
|
"SophiaScript.json" = @{ |
|
|
|
|
|
content = $GistContent |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} | ConvertTo-Json |
|
|
|
|
|
$Headers = @{ |
|
|
|
|
|
Authorization = "Bearer $env:GIST_TOKEN" |
|
|
|
|
|
Accept = "application/vnd.github+json" |
|
|
|
|
|
} |
|
|
|
|
|
$Parameters = @{ |
|
|
|
|
|
Uri = "https://api.github.com/gists/9852d6b9569a91bf69ceba8a94cc97f4" |
|
|
|
|
|
Method = "Patch" |
|
|
|
|
|
Body = $Body |
|
|
|
|
|
Headers = $Headers |
|
|
|
|
|
UseBasicParsing = $true |
|
|
|
|
|
Verbose = $true |
|
|
|
|
|
} |
|
|
|
|
|
Invoke-RestMethod @Parameters |
|
|
|