Skip to content

Commit a7c5dd4

Browse files
authored
Merge branch 'main' into antonis/upgrade-perf-test-apps-rn-0.85.1
2 parents fbd7702 + d8ef728 commit a7c5dd4

3 files changed

Lines changed: 86 additions & 0 deletions

File tree

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: "Automation: Notify issues for release"
2+
on:
3+
release:
4+
types:
5+
- published
6+
workflow_dispatch:
7+
inputs:
8+
version:
9+
description: Which version to notify issues for
10+
required: true
11+
12+
permissions:
13+
contents: read
14+
issues: write
15+
pull-requests: read
16+
17+
jobs:
18+
release-comment-issues:
19+
runs-on: ubuntu-latest
20+
name: "Notify issues"
21+
steps:
22+
- name: Get version
23+
id: get_version
24+
env:
25+
INPUTS_VERSION: ${{ github.event.inputs.version }}
26+
RELEASE_TAG_NAME: ${{ github.event.release.tag_name }}
27+
run: echo "version=${INPUTS_VERSION:-$RELEASE_TAG_NAME}" >> "$GITHUB_OUTPUT"
28+
29+
- name: Comment on linked issues that are mentioned in release
30+
if: |
31+
steps.get_version.outputs.version != ''
32+
&& !contains(steps.get_version.outputs.version, '-beta.')
33+
&& !contains(steps.get_version.outputs.version, '-alpha.')
34+
&& !contains(steps.get_version.outputs.version, '-rc.')
35+
uses: getsentry/release-comment-issues-gh-action@v1
36+
with:
37+
github_token: ${{ secrets.GITHUB_TOKEN }}
38+
version: ${{ steps.get_version.outputs.version }}

scripts/check-additional-danger.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ module.exports = async function ({ fail, warn, message, markdown, danger }) {
1111
await safeRun('./check-github-label', { fail, warn, message, markdown, danger });
1212
await safeRun('./check-replay-stubs', { fail, warn, message, markdown, danger });
1313
await safeRun('./check-android-sdk-mismatch', { fail, warn, message, markdown, danger });
14+
await safeRun('./check-auth-token-changes', { fail, warn, message, markdown, danger });
1415
};
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
const AUTH_TOKEN_PATTERN = /\b(SENTRY_AUTH_TOKEN|auth[._]token)\b|[Aa]uth[Tt]oken/;
2+
3+
const EXCLUDED_PATHS = [
4+
/^\.github\//,
5+
/^CHANGELOG\.md$/,
6+
];
7+
8+
module.exports = async function ({ fail, warn, __, ___, danger }) {
9+
const allChangedFiles = [
10+
...danger.git.modified_files,
11+
...danger.git.created_files,
12+
].filter(file => !EXCLUDED_PATHS.some(pattern => pattern.test(file)));
13+
14+
const flaggedFiles = [];
15+
16+
for (const file of allChangedFiles) {
17+
try {
18+
const diff = await danger.git.structuredDiffForFile(file);
19+
if (!diff) {
20+
continue;
21+
}
22+
23+
const hasAuthTokenChange = diff.chunks.some(chunk =>
24+
chunk.changes.some(change =>
25+
change.add && AUTH_TOKEN_PATTERN.test(change.content)
26+
)
27+
);
28+
29+
if (hasAuthTokenChange) {
30+
flaggedFiles.push(file);
31+
}
32+
} catch (_error) {
33+
// Skip files where diff fails (e.g. binary files)
34+
}
35+
}
36+
37+
if (flaggedFiles.length > 0) {
38+
const fileList = flaggedFiles.map(file => `- \`${file}\``).join("\n");
39+
warn(
40+
`### ⚠️ Auth token handling changes detected\n\n` +
41+
`This PR modifies code related to Sentry auth token handling. ` +
42+
`Please ensure no auth tokens are accidentally exposed or mishandled. ` +
43+
`See [GHSA-68c2-4mpx-qh95](https://github.com/getsentry/sentry-react-native/security/advisories/GHSA-68c2-4mpx-qh95) for context.\n\n` +
44+
`Files with auth token changes:\n${fileList}`
45+
);
46+
}
47+
};

0 commit comments

Comments
 (0)