Skip to content

Commit

Permalink
Update _postDiffToGitHubSnippet.nix
Browse files Browse the repository at this point in the history
  • Loading branch information
oneingan authored Oct 18, 2024
1 parent 157ad74 commit 2f4df74
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/std/fwlib/blockTypes/_postDiffToGitHubSnippet.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ _: path: cmd: script: ''
fi
CENTRAL_COMMENT_HEADER="<!-- Unified Diff Comment -->"
ENTRY_START_MARKER="<!-- Start Diff for \`${path}\` -->"
ENTRY_END_MARKER="<!-- End Diff for \`${path}\` -->"
ENTRY_START_MARKER="<!-- Start Diff for ${path}:${cmd} -->"
ENTRY_END_MARKER="<!-- End Diff for ${path}:${cmd} -->"
DIFF_ENTRY=$(cat <<EOF
$ENTRY_START_MARKER
<details>
<summary>Diff for \`${path}\` (\`${cmd}\`)</summary>
<summary>//${path}:${cmd}</summary>
\`\`\`diff
$DIFF_OUTPUT
Expand All @@ -40,7 +40,7 @@ EOF
EXISTING_BODY=$(gh api "repos/$OWNER_REPO_NAME/issues/comments/$EXISTING_COMMENT_ID" --jq '.body')
if echo "$EXISTING_BODY" | grep -q "$ENTRY_START_MARKER"; then
UPDATED_BODY=$(echo "$EXISTING_BODY" | sed -e "/$ENTRY_START_MARKER/,/$ENTRY_END_MARKER/d")
UPDATED_BODY=$(echo "$EXISTING_BODY" | sed -e "\#$ENTRY_START_MARKER#,\#$ENTRY_END_MARKER#d")
else
UPDATED_BODY="$EXISTING_BODY"
fi
Expand Down

0 comments on commit 2f4df74

Please sign in to comment.