Skip to content

Commit

Permalink
Escape backticks in YML
Browse files Browse the repository at this point in the history
This time is should work even with double "quotes" or 'quotes' in description.
  • Loading branch information
Benualdo committed Nov 14, 2024
1 parent 3af6205 commit be71eb4
Show file tree
Hide file tree
Showing 14 changed files with 74 additions and 26 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/ARM64EC_DX12_Debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ jobs:
$description = if ($splitMessage.Length -gt 1) { $splitMessage[1] } else { "" }
$escapedSummary = $summary -replace '"', '\"' -replace "`r`n", ' ' -replace "`n", ' '
$escapedDescription = $description -replace '"', '\"' -replace "`r`n", ' ' -replace "`n", ' '
$title = "${{ github.workflow }} build succeeded ``$shortCommitSha``"
$jsonPayload = @"
{
Expand All @@ -98,7 +100,7 @@ jobs:
"embeds": [
{
"type": "rich",
"title": "ARM64EC DX12 Debug build succeeded `$shortCommitSha`",
"title": $title,
"description": "$escapedSummary",
"color": 38912,
"thumbnail": {
Expand Down Expand Up @@ -142,14 +144,16 @@ jobs:
$escapedSummary = $summary -replace '"', '\"' -replace "`r`n", ' ' -replace "`n", ' '
$escapedDescription = $description -replace '"', '\"' -replace "`r`n", ' ' -replace "`n", ' '
$title = "${{ github.workflow }} build failed ``$shortCommitSha``"
$jsonPayload = @"
{
"username": "Gros Covid",
"content": "",
"embeds": [
{
"type": "rich",
"title": "ARM64EC DX12 Debug build failed `$shortCommitSha`",
"title": $title,
"description": "$escapedSummary",
"color": 16515049,
"thumbnail": {
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/ARM64EC_DX12_Final.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,16 @@ jobs:
$escapedSummary = $summary -replace '"', '\"' -replace "`r`n", ' ' -replace "`n", ' '
$escapedDescription = $description -replace '"', '\"' -replace "`r`n", ' ' -replace "`n", ' '
$title = "${{ github.workflow }} build succeeded ``$shortCommitSha``"
$jsonPayload = @"
{
"username": "Gros Covid",
"content": "",
"embeds": [
{
"type": "rich",
"title": "ARM64EC DX12 Final build succeeded `$shortCommitSha`",
"title": $title,
"description": "$escapedSummary",
"color": 38912,
"thumbnail": {
Expand Down Expand Up @@ -142,14 +144,16 @@ jobs:
$escapedSummary = $summary -replace '"', '\"' -replace "`r`n", ' ' -replace "`n", ' '
$escapedDescription = $description -replace '"', '\"' -replace "`r`n", ' ' -replace "`n", ' '
$title = "${{ github.workflow }} build failed ``$shortCommitSha``"
$jsonPayload = @"
{
"username": "Gros Covid",
"content": "",
"embeds": [
{
"type": "rich",
"title": "ARM64EC DX12 Final build failed `$shortCommitSha`",
"title": $title,
"description": "$escapedSummary",
"color": 16515049,
"thumbnail": {
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/ARM64EC_DX12_Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,16 @@ jobs:
$escapedSummary = $summary -replace '"', '\"' -replace "`r`n", ' ' -replace "`n", ' '
$escapedDescription = $description -replace '"', '\"' -replace "`r`n", ' ' -replace "`n", ' '
$title = "${{ github.workflow }} build succeeded ``$shortCommitSha``"
$jsonPayload = @"
{
"username": "Gros Covid",
"content": "",
"embeds": [
{
"type": "rich",
"title": "ARM64EC DX12 Release build succeeded `$shortCommitSha`",
"title": $title,
"description": "$escapedSummary",
"color": 38912,
"thumbnail": {
Expand Down Expand Up @@ -142,14 +144,16 @@ jobs:
$escapedSummary = $summary -replace '"', '\"' -replace "`r`n", ' ' -replace "`n", ' '
$escapedDescription = $description -replace '"', '\"' -replace "`r`n", ' ' -replace "`n", ' '
$title = "${{ github.workflow }} build failed ``$shortCommitSha``"
$jsonPayload = @"
{
"username": "Gros Covid",
"content": "",
"embeds": [
{
"type": "rich",
"title": "ARM64EC DX12 Release build failed `$shortCommitSha`",
"title": $title,
"description": "$escapedSummary",
"color": 16515049,
"thumbnail": {
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/ARM64EC_Vulkan_Debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,16 @@ jobs:
$escapedSummary = $summary -replace '"', '\"' -replace "`r`n", ' ' -replace "`n", ' '
$escapedDescription = $description -replace '"', '\"' -replace "`r`n", ' ' -replace "`n", ' '
$title = "${{ github.workflow }} build succeeded ``$shortCommitSha``"
$jsonPayload = @"
{
"username": "Gros Covid",
"content": "",
"embeds": [
{
"type": "rich",
"title": "ARM64EC Vulkan Debug build succeeded `$shortCommitSha`",
"title": $title,
"description": "$escapedSummary",
"color": 38912,
"thumbnail": {
Expand Down Expand Up @@ -149,14 +151,16 @@ jobs:
$escapedSummary = $summary -replace '"', '\"' -replace "`r`n", ' ' -replace "`n", ' '
$escapedDescription = $description -replace '"', '\"' -replace "`r`n", ' ' -replace "`n", ' '
$title = "${{ github.workflow }} build failed ``$shortCommitSha``"
$jsonPayload = @"
{
"username": "Gros Covid",
"content": "",
"embeds": [
{
"type": "rich",
"title": "ARM64EC Vulkan Debug build failed `$shortCommitSha`",
"title": $title,
"description": "$escapedSummary",
"color": 16515049,
"thumbnail": {
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/ARM64EC_Vulkan_Final.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,16 @@ jobs:
$escapedSummary = $summary -replace '"', '\"' -replace "`r`n", ' ' -replace "`n", ' '
$escapedDescription = $description -replace '"', '\"' -replace "`r`n", ' ' -replace "`n", ' '
$title = "${{ github.workflow }} build succeeded ``$shortCommitSha``"
$jsonPayload = @"
{
"username": "Gros Covid",
"content": "",
"embeds": [
{
"type": "rich",
"title": "ARM64EC Vulkan Final build succeeded `$shortCommitSha`",
"title": $title,
"description": "$escapedSummary",
"color": 38912,
"thumbnail": {
Expand Down Expand Up @@ -149,14 +151,16 @@ jobs:
$escapedSummary = $summary -replace '"', '\"' -replace "`r`n", ' ' -replace "`n", ' '
$escapedDescription = $description -replace '"', '\"' -replace "`r`n", ' ' -replace "`n", ' '
$title = "${{ github.workflow }} build failed ``$shortCommitSha``"
$jsonPayload = @"
{
"username": "Gros Covid",
"content": "",
"embeds": [
{
"type": "rich",
"title": "ARM64EC Vulkan Final build failed `$shortCommitSha`",
"title": $title,
"description": "$escapedSummary",
"color": 16515049,
"thumbnail": {
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/ARM64EC_Vulkan_Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,16 @@ jobs:
$escapedSummary = $summary -replace '"', '\"' -replace "`r`n", ' ' -replace "`n", ' '
$escapedDescription = $description -replace '"', '\"' -replace "`r`n", ' ' -replace "`n", ' '
$title = "${{ github.workflow }} build succeeded ``$shortCommitSha``"
$jsonPayload = @"
{
"username": "Gros Covid",
"content": "",
"embeds": [
{
"type": "rich",
"title": "ARM64EC Vulkan Release build succeeded `$shortCommitSha`",
"title": $title,
"description": "$escapedSummary",
"color": 38912,
"thumbnail": {
Expand Down Expand Up @@ -149,14 +151,16 @@ jobs:
$escapedSummary = $summary -replace '"', '\"' -replace "`r`n", ' ' -replace "`n", ' '
$escapedDescription = $description -replace '"', '\"' -replace "`r`n", ' ' -replace "`n", ' '
$title = "${{ github.workflow }} build failed ``$shortCommitSha``"
$jsonPayload = @"
{
"username": "Gros Covid",
"content": "",
"embeds": [
{
"type": "rich",
"title": "ARM64EC Vulkan Release build failed `$shortCommitSha`",
"title": $title,
"description": "$escapedSummary",
"color": 16515049,
"thumbnail": {
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/Submit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
$escapedSummary = $summary -replace '"', '\"' -replace "`r`n", ' ' -replace "`n", ' '
$escapedDescription = $description -replace '"', '\"' -replace "`r`n", ' ' -replace "`n", ' '
$title = "$escapedSummary `$shortCommitSha`"
$title = "$escapedSummary ``$shortCommitSha``"
# Prepare the JSON payload
$jsonPayload = @"
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/Win64_DX12_Debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,16 @@ jobs:
$escapedSummary = $summary -replace '"', '\"' -replace "`r`n", ' ' -replace "`n", ' '
$escapedDescription = $description -replace '"', '\"' -replace "`r`n", ' ' -replace "`n", ' '
$title = "${{ github.workflow }} build succeeded ``$shortCommitSha``"
$jsonPayload = @"
{
"username": "Gros Covid",
"content": "",
"embeds": [
{
"type": "rich",
"title": "Win64 DX12 Debug build succeeded `$shortCommitSha`",
"title": $title,
"description": "$escapedSummary",
"color": 38912,
"thumbnail": {
Expand Down Expand Up @@ -142,14 +144,16 @@ jobs:
$escapedSummary = $summary -replace '"', '\"' -replace "`r`n", ' ' -replace "`n", ' '
$escapedDescription = $description -replace '"', '\"' -replace "`r`n", ' ' -replace "`n", ' '
$title = "${{ github.workflow }} build failed ``$shortCommitSha``"
$jsonPayload = @"
{
"username": "Gros Covid",
"content": "",
"embeds": [
{
"type": "rich",
"title": "Win64 DX12 Debug build failed `$shortCommitSha`",
"title": $title,
"description": "$escapedSummary",
"color": 16515049,
"thumbnail": {
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/Win64_DX12_Final.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,16 @@ jobs:
$escapedSummary = $summary -replace '"', '\"' -replace "`r`n", ' ' -replace "`n", ' '
$escapedDescription = $description -replace '"', '\"' -replace "`r`n", ' ' -replace "`n", ' '
$title = "${{ github.workflow }} build succeeded ``$shortCommitSha``"
$jsonPayload = @"
{
"username": "Gros Covid",
"content": "",
"embeds": [
{
"type": "rich",
"title": "Win64 DX12 Final build succeeded `$shortCommitSha`",
"title": $title,
"description": "$escapedSummary",
"color": 38912,
"thumbnail": {
Expand Down Expand Up @@ -142,14 +144,16 @@ jobs:
$escapedSummary = $summary -replace '"', '\"' -replace "`r`n", ' ' -replace "`n", ' '
$escapedDescription = $description -replace '"', '\"' -replace "`r`n", ' ' -replace "`n", ' '
$title = "${{ github.workflow }} build failed ``$shortCommitSha``"
$jsonPayload = @"
{
"username": "Gros Covid",
"content": "",
"embeds": [
{
"type": "rich",
"title": "Win64 DX12 Final build failed `$shortCommitSha`",
"title": $title,
"description": "$escapedSummary",
"color": 16515049,
"thumbnail": {
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/Win64_DX12_Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,16 @@ jobs:
$escapedSummary = $summary -replace '"', '\"' -replace "`r`n", ' ' -replace "`n", ' '
$escapedDescription = $description -replace '"', '\"' -replace "`r`n", ' ' -replace "`n", ' '
$title = "${{ github.workflow }} build succeeded ``$shortCommitSha``"
$jsonPayload = @"
{
"username": "Gros Covid",
"content": "",
"embeds": [
{
"type": "rich",
"title": "Win64 DX12 Release build succeeded `$shortCommitSha`",
"title": $title,
"description": "$escapedSummary",
"color": 38912,
"thumbnail": {
Expand Down Expand Up @@ -142,14 +144,16 @@ jobs:
$escapedSummary = $summary -replace '"', '\"' -replace "`r`n", ' ' -replace "`n", ' '
$escapedDescription = $description -replace '"', '\"' -replace "`r`n", ' ' -replace "`n", ' '
$title = "${{ github.workflow }} build failed ``$shortCommitSha``"
$jsonPayload = @"
{
"username": "Gros Covid",
"content": "",
"embeds": [
{
"type": "rich",
"title": "Win64 DX12 Release build failed `$shortCommitSha`",
"title": $title,
"description": "$escapedSummary",
"color": 16515049,
"thumbnail": {
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/Win64_Vulkan_Debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,16 @@ jobs:
$escapedSummary = $summary -replace '"', '\"' -replace "`r`n", ' ' -replace "`n", ' '
$escapedDescription = $description -replace '"', '\"' -replace "`r`n", ' ' -replace "`n", ' '
$title = "${{ github.workflow }} build succeeded ``$shortCommitSha``"
$jsonPayload = @"
{
"username": "Gros Covid",
"content": "",
"embeds": [
{
"type": "rich",
"title": "Win64 Vulkan Debug build succeeded `$shortCommitSha`",
"title": $title,
"description": "$escapedSummary",
"color": 38912,
"thumbnail": {
Expand Down Expand Up @@ -149,14 +151,16 @@ jobs:
$escapedSummary = $summary -replace '"', '\"' -replace "`r`n", ' ' -replace "`n", ' '
$escapedDescription = $description -replace '"', '\"' -replace "`r`n", ' ' -replace "`n", ' '
$title = "${{ github.workflow }} build failed ``$shortCommitSha``"
$jsonPayload = @"
{
"username": "Gros Covid",
"content": "",
"embeds": [
{
"type": "rich",
"title": "Win64 Vulkan Debug build failed `$shortCommitSha`",
"title": $title,
"description": "$escapedSummary",
"color": 16515049,
"thumbnail": {
Expand Down
Loading

0 comments on commit be71eb4

Please sign in to comment.