-
-
Notifications
You must be signed in to change notification settings - Fork 318
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: High risk file changes as PR comment (#3554)
Remove the no changes in high-risk file script and hashes, and replace it by adding a GH PR comment.
- Loading branch information
1 parent
26d116c
commit 42ef6ba
Showing
6 changed files
with
63 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# This is used by the action https://github.com/dorny/paths-filter (which we have forked to https://github.com/getsentry/paths-filter) | ||
|
||
high_risk_code: &high_risk_code | ||
- 'Sources/Sentry/SentryNSURLSessionTaskSearch.m' | ||
- 'Sources/Sentry/SentryNetworkTracker.m' | ||
- 'Sources/Sentry/SentryUIViewControllerSwizzling.m' | ||
- 'Sources/Sentry/SentryNSDataSwizzling.m' | ||
- 'Sources/Sentry/SentrySubClassFinder.m' | ||
- 'Sources/Sentry/SentryCoreDataSwizzling.m' | ||
- 'Sources/Sentry/SentrySwizzleWrapper.m' | ||
- 'Sources/Sentry/include/SentrySwizzle.h' | ||
- 'Sources/Sentry/SentrySwizzle.m' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Changes In High Risk Code | ||
on: | ||
pull_request: | ||
|
||
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
files-changed: | ||
name: Detect changed files | ||
runs-on: ubuntu-latest | ||
# Map a step output to a job output | ||
outputs: | ||
high_risk_code: ${{ steps.changes.outputs.high_risk_code }} | ||
high_risk_code_files: ${{ steps.changes.outputs.high_risk_code_files }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Get changed files | ||
id: changes | ||
uses: getsentry/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 # v2.11.1 | ||
with: | ||
token: ${{ github.token }} | ||
filters: .github/file-filters.yml | ||
|
||
# Enable listing of files matching each filter. | ||
# Paths to files will be available in `${FILTER_NAME}_files` output variable. | ||
list-files: csv | ||
|
||
validate-high-risk-code: | ||
if: needs.files-changed.outputs.high_risk_code == 'true' | ||
needs: files-changed | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Comment on PR to notify of changes in high risk files | ||
uses: actions/github-script@v7 | ||
env: | ||
high_risk_code: ${{ needs.files-changed.outputs.high_risk_code_files }} | ||
with: | ||
script: | | ||
const highRiskFiles = process.env.high_risk_code; | ||
const fileList = highRiskFiles.split(',').map(file => `- [ ] ${file}`).join('\n'); | ||
github.rest.issues.createComment({ | ||
issue_number: context.issue.number, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
body: `### 🚨 Detected changes in high risk code 🚨 \n High-risk code can easily blow up and is hard to test. We had severe bugs in the past. Be extra careful when changing these files, and have an extra careful look at these:\n ${fileList}` | ||
}) | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.