|
7 | 7 | paths: |
8 | 8 | - "packages/**" |
9 | 9 | - ".changeset/**" |
| 10 | + - ".server-changes/**" |
10 | 11 | - "package.json" |
11 | 12 | - "pnpm-lock.yaml" |
12 | 13 |
|
|
50 | 51 | env: |
51 | 52 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
52 | 53 |
|
53 | | - - name: Update PR title with version |
| 54 | + - name: Update PR title and enhance body |
54 | 55 | if: steps.changesets.outputs.published != 'true' |
55 | 56 | env: |
56 | 57 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
|
61 | 62 | # we arbitrarily reference the version of the cli package here; it is the same for all package releases |
62 | 63 | VERSION=$(git show origin/changeset-release/main:packages/cli-v3/package.json | jq -r '.version') |
63 | 64 | gh pr edit "$PR_NUMBER" --title "chore: release v$VERSION" |
| 65 | +
|
| 66 | + # Enhance the PR body with a clean, deduplicated summary |
| 67 | + RAW_BODY=$(gh pr view "$PR_NUMBER" --json body --jq '.body') |
| 68 | + ENHANCED_BODY=$(CHANGESET_PR_BODY="$RAW_BODY" node scripts/enhance-release-pr.mjs "$VERSION") |
| 69 | + if [ -n "$ENHANCED_BODY" ]; then |
| 70 | + gh api repos/triggerdotdev/trigger.dev/pulls/"$PR_NUMBER" \ |
| 71 | + -X PATCH \ |
| 72 | + -f body="$ENHANCED_BODY" |
| 73 | + fi |
64 | 74 | fi |
65 | 75 |
|
66 | 76 | update-lockfile: |
@@ -88,15 +98,26 @@ jobs: |
88 | 98 | - name: Install and update lockfile |
89 | 99 | run: pnpm install --no-frozen-lockfile |
90 | 100 |
|
91 | | - - name: Commit and push lockfile |
| 101 | + - name: Clean up consumed .server-changes/ files |
92 | 102 | run: | |
93 | 103 | set -e |
94 | | - if git diff --quiet pnpm-lock.yaml; then |
95 | | - echo "No lockfile changes" |
96 | | - else |
97 | | - git config user.name "github-actions[bot]" |
98 | | - git config user.email "github-actions[bot]@users.noreply.github.com" |
99 | | - git add pnpm-lock.yaml |
100 | | - git commit -m "chore: update lockfile for release" |
| 104 | + shopt -s nullglob |
| 105 | + files=(.server-changes/*.md) |
| 106 | + for f in "${files[@]}"; do |
| 107 | + if [ "$(basename "$f")" != "README.md" ]; then |
| 108 | + git rm --ignore-unmatch "$f" |
| 109 | + fi |
| 110 | + done |
| 111 | +
|
| 112 | + - name: Commit and push lockfile + server-changes cleanup |
| 113 | + run: | |
| 114 | + set -e |
| 115 | + git config user.name "github-actions[bot]" |
| 116 | + git config user.email "github-actions[bot]@users.noreply.github.com" |
| 117 | + git add pnpm-lock.yaml |
| 118 | + if ! git diff --cached --quiet; then |
| 119 | + git commit -m "chore: update lockfile and clean up .server-changes/ for release" |
101 | 120 | git push origin changeset-release/main |
| 121 | + else |
| 122 | + echo "No changes to commit" |
102 | 123 | fi |
0 commit comments