Skip to content

Commit e3e6d58

Browse files
authored
fix: write CI-generated pr-body.md and pr-data.jsonl to /tmp/ instead of repo root (#433)
1 parent f42eead commit e3e6d58

1 file changed

Lines changed: 13 additions & 13 deletions

File tree

.github/workflows/gen-release-pr.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ jobs:
9494
# Collect data for rich PR body
9595
PR_AUTHOR=$(gh api repos/$OWNER/$REPO/pulls/$PR_NUM --jq '.user.login' 2>/dev/null || echo "unknown")
9696
LABELS_JSON=$(echo "$LABELS" | jq -R -s 'split("\n") | map(select(length > 0))')
97-
echo "{\"number\":$PR_NUM,\"title\":$(echo "$PR_TITLE" | jq -Rs .),\"author\":\"$PR_AUTHOR\",\"labels\":$LABELS_JSON}" >> pr-data.jsonl
97+
echo "{\"number\":$PR_NUM,\"title\":$(echo "$PR_TITLE" | jq -Rs .),\"author\":\"$PR_AUTHOR\",\"labels\":$LABELS_JSON}" >> /tmp/pr-data.jsonl
9898
fi
9999
done <<< "$COMMITS"
100100
@@ -196,7 +196,7 @@ jobs:
196196
--file /tmp/release-notes.txt
197197
198198
# Read PR data
199-
ALL_PRS=$(jq -s '.' pr-data.jsonl)
199+
ALL_PRS=$(jq -s '.' /tmp/pr-data.jsonl)
200200
201201
# Categorize PRs for the body list (just #XYZ, no title)
202202
MAJOR_PRS=$(echo "$ALL_PRS" | jq -r '.[] | select(.labels | index("major")) | .author |= gsub("^app/"; "") | "- #\(.number) — @\(.author)"')
@@ -207,7 +207,7 @@ jobs:
207207
CONTRIBUTORS=$(echo "$ALL_PRS" | jq -r '[.[].author] | unique | map(gsub("^app/"; "")) | .[] | "@\(.)"' | paste -sd ', ')
208208
209209
# Build the PR body header
210-
cat > pr-body.md <<- BODY
210+
cat > /tmp/pr-body.md <<- BODY
211211
## Automated Release Prep
212212
213213
**Release Type:** ${{ steps.unreleased.outputs.release-type }}
@@ -222,22 +222,22 @@ jobs:
222222
223223
# Add categorized PRs (just #XYZ format)
224224
if [ -n "$MAJOR_PRS" ]; then
225-
echo -e "\n**🚨 Major Changes**\n$MAJOR_PRS" >> pr-body.md
225+
echo -e "\n**🚨 Major Changes**\n$MAJOR_PRS" >> /tmp/pr-body.md
226226
fi
227227
if [ -n "$MINOR_PRS" ]; then
228-
echo -e "\n**✨ New Features**\n$MINOR_PRS" >> pr-body.md
228+
echo -e "\n**✨ New Features**\n$MINOR_PRS" >> /tmp/pr-body.md
229229
fi
230230
if [ -n "$PATCH_PRS" ]; then
231-
echo -e "\n**🐛 Bug Fixes**\n$PATCH_PRS" >> pr-body.md
231+
echo -e "\n**🐛 Bug Fixes**\n$PATCH_PRS" >> /tmp/pr-body.md
232232
fi
233233
if [ -n "$UNLABELED_PRS" ]; then
234-
echo -e "\n**📝 Other / Infrastructure**\n$UNLABELED_PRS" >> pr-body.md
234+
echo -e "\n**📝 Other / Infrastructure**\n$UNLABELED_PRS" >> /tmp/pr-body.md
235235
fi
236236
237-
echo -e "\n\n**Contributors:** ${CONTRIBUTORS}" >> pr-body.md
237+
echo -e "\n\n**Contributors:** ${CONTRIBUTORS}" >> /tmp/pr-body.md
238238
239239
# Add collapsible release notes preview
240-
cat >> pr-body.md <<- PREVIEW
240+
cat >> /tmp/pr-body.md <<- PREVIEW
241241
242242
---
243243
@@ -249,9 +249,9 @@ jobs:
249249
\`\`\`\`
250250
PREVIEW
251251
252-
cat /tmp/release-notes.txt >> pr-body.md
252+
cat /tmp/release-notes.txt >> /tmp/pr-body.md
253253
254-
cat >> pr-body.md <<- PREVIEW
254+
cat >> /tmp/pr-body.md <<- PREVIEW
255255
\`\`\`\`
256256
257257
</details>
@@ -263,7 +263,7 @@ jobs:
263263
PREVIEW
264264
265265
echo "Generated PR body:"
266-
cat pr-body.md
266+
cat /tmp/pr-body.md
267267
268268
- name: Create release PR
269269
if: steps.version-update.outputs.new-version != ''
@@ -272,7 +272,7 @@ jobs:
272272
token: ${{ secrets.GITHUB_TOKEN }}
273273
commit-message: "chore: prepare release ${{ steps.version-update.outputs.new-version }}"
274274
title: "Release Prep ${{ steps.version-update.outputs.new-version }}"
275-
body-path: pr-body.md
275+
body-path: /tmp/pr-body.md
276276
branch: release-prep
277277
base: ${{ github.ref_name }}
278278
labels: |

0 commit comments

Comments
 (0)