Skip to content

Conversation

lucas-zimerman
Copy link
Contributor

@lucas-zimerman lucas-zimerman commented Oct 6, 2025

Based on V2.

The PR allows the danger CI to also include dangerfiles from the repo. This is good since only one github comment is allowed per repo, meaning that without this change, the danger used by the repo will overwrite the comment done by this repo.

This change adds a new step, loading an external dangerfile if set.
It passes the default parameters as exposing the following items:
fail

  • warn
  • message
  • markdown
  • danger

The changes were tested on the following PR:
getsentry/sentry-react-native#5235 (comment)

How external libraries should be implemented

Here is a example file using the changes: https://github.com/getsentry/sentry-react-native/blob/3dcd68b8db138e90aff72d51e46f89a6b0b70b0c/scripts/check-replay-stubs.js
If there is approval on merging these changes on this repo, I will update the readme file with guides on how to use an external dangerfile

#skip-changelog

@lucas-zimerman
Copy link
Contributor Author

@vaind What do you think of this feature?

@lucas-zimerman
Copy link
Contributor Author

Q: Should I target V3?

@vaind
Copy link
Collaborator

vaind commented Oct 8, 2025

@vaind What do you think of this feature?

Hey, haven't had a chance to look yet but makes sense in general.

@vaind
Copy link
Collaborator

vaind commented Oct 9, 2025

Note: danger-js has been updated by #132 (updater job added in #131)

@lucas-zimerman
Copy link
Contributor Author

sorry for the extra tests I added (they got reverted), I wasn't sure why danger for changelogs wasn't triggering, turned out there are new filters that it skips the changelog check based on the title description that didn't happen on V2.

@lucas-zimerman lucas-zimerman marked this pull request as ready for review October 9, 2025 12:59
@lucas-zimerman lucas-zimerman requested a review from vaind October 9, 2025 13:01
@lucas-zimerman lucas-zimerman marked this pull request as draft October 10, 2025 10:41
@lucas-zimerman
Copy link
Contributor Author

Testesd the following cases here:

Run with extra-dangerfile and extra-install-packages
https://github.com/getsentry/sentry-react-native/actions/runs/18411426970/job/52464497860

Run with extra-dangerfile and malicious shell script
https://github.com/getsentry/sentry-react-native/actions/runs/18411514303/job/52464814813?pr=5235

Run with no extra parameters
https://github.com/getsentry/sentry-react-native/actions/runs/18411569658/job/52465003681?pr=5235

Run with extra-dangerfile, extra-install-packages and a valid diff check for extra-dangerfile
https://github.com/getsentry/sentry-react-native/actions/runs/18412024717/job/52466642228?pr=5235

@lucas-zimerman lucas-zimerman marked this pull request as ready for review October 10, 2025 16:14
@lucas-zimerman
Copy link
Contributor Author

@vaind I added the following steps:

  • Validate package names Avoids running the CI if there is anything suspicious on extra-install-packages.
  • Setup container is the old Run DangerJS without the part of running danger.
  • Setup additional packages sets all new packages as root if set.
  • Run DangerJS like the original, doesn't run danger as root.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants