Skip to content

Commit c14a9b3

Browse files
authored
ci: Auto SDK update PRs now include SDK version in name for release notes (#1288)
1 parent fe359df commit c14a9b3

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

.github/workflows/new-sdk-versions-pr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
token: ${{ secrets.GITHUB_TOKEN }}
2727
branch: test/new-sdk-version
2828
delete-branch: true
29-
title: 'test: New Sentry SDK version'
30-
commit-message: 'test: New Sentry SDK version'
29+
title: 'feat: Update Sentry SDKs to v${{ env.SENTRY_LATEST_VERSION }}'
30+
commit-message: 'feat: Update Sentry SDKs to v${{ env.SENTRY_LATEST_VERSION }}'
3131
body: |
3232
Automatically generated PR to test new Sentry SDK version

scripts/update-sdk-versions.mjs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { spawnSync } from 'child_process';
2-
import { readFileSync, writeFileSync } from 'fs';
2+
import { appendFileSync, readFileSync, writeFileSync } from 'fs';
33
import { join } from 'path';
44
import { fileURLToPath } from 'url';
5+
import { EOL } from 'os';
56

67
const __dirname = fileURLToPath(new URL('.', import.meta.url));
78

@@ -42,5 +43,11 @@ if (current !== latest) {
4243
spawnSync('yarn', ['install'], { stdio: 'inherit' });
4344
// Update parameter that has the version in it
4445
spawnSync('yarn', ['build'], { stdio: 'inherit' });
46+
47+
// If we're in a GH Action, add the version in GITHUB_ENV so it can be used to name the PR
48+
const envFilePath = process.env.GITHUB_ENV;
49+
if (envFilePath) {
50+
appendFileSync(envFilePath, `SENTRY_LATEST_VERSION=${latest}${EOL}`, { encoding: 'utf8' });
51+
}
4552
}
4653

0 commit comments

Comments
 (0)