Skip to content

Commit fa196d6

Browse files
cursoragent4ian
andcommitted
Use random heredoc delimiters for GITHUB_OUTPUT to avoid collisions
Replaces fixed SUMMARY_EOF/COMMITS_EOF delimiters with randomized ones (EOF_<random hex>) and adds an extra blank line before the closing delimiter to ensure GitHub parses the multiline output correctly. Co-authored-by: Florian Rival <4ian@users.noreply.github.com>
1 parent eb8266a commit fa196d6

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

.github/workflows/improve-docs.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,12 @@ jobs:
6262
6363
# Pass the AI summary to subsequent steps
6464
if [ -f /tmp/ai_summary.txt ]; then
65+
delimiter="EOF_$(openssl rand -hex 8)"
6566
{
66-
echo "summary<<SUMMARY_EOF"
67+
echo "summary<<${delimiter}"
6768
cat /tmp/ai_summary.txt
68-
echo "SUMMARY_EOF"
69+
echo ""
70+
echo "${delimiter}"
6971
} >> "$GITHUB_OUTPUT"
7072
fi
7173

.github/workflows/update-docs-from-commits.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,17 +62,21 @@ jobs:
6262
6363
# Pass the AI summary and commit log to subsequent steps
6464
if [ -f /tmp/ai_summary.txt ]; then
65+
delimiter="EOF_$(openssl rand -hex 8)"
6566
{
66-
echo "summary<<SUMMARY_EOF"
67+
echo "summary<<${delimiter}"
6768
cat /tmp/ai_summary.txt
68-
echo "SUMMARY_EOF"
69+
echo ""
70+
echo "${delimiter}"
6971
} >> "$GITHUB_OUTPUT"
7072
fi
7173
if [ -f /tmp/commit_log.txt ]; then
74+
delimiter="EOF_$(openssl rand -hex 8)"
7275
{
73-
echo "commits<<COMMITS_EOF"
76+
echo "commits<<${delimiter}"
7477
cat /tmp/commit_log.txt
75-
echo "COMMITS_EOF"
78+
echo ""
79+
echo "${delimiter}"
7680
} >> "$GITHUB_OUTPUT"
7781
fi
7882

0 commit comments

Comments
 (0)