Skip to content

Commit

Permalink
fix: mitigate DangerJS transpilation bug (#47192)
Browse files Browse the repository at this point in the history
Summary:
Danger seems to have a bug where it's not transpiling the import of
rnx-kit/rn-changelog-generator. This mitigates the issue to get our
project back on track.

This can be replicated locally by:

```bash
DEBUG="*" DANGER_GITHUB_API_TOKEN=$GITHUB_TOKEN yarn danger pr #47182
```
You can see it running correctly here when switching to the branch with the fix.  **I'm a little concerned that this is still failing on the PR**.  Thoughts?

 {F1946190275}

Changelog: [internal]

Pull Request resolved: #47192

Reviewed By: cortinico

Differential Revision: D64924466

Pulled By: blakef

fbshipit-source-id: 68df0521620809effe3a78ce842e043382ad64a6
  • Loading branch information
blakef authored and facebook-github-bot committed Oct 25, 2024
1 parent e851e73 commit 94fdc38
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/react-native-bots/dangerfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
*/

'use strict';

const {validate: validateChangelog} =
require('@rnx-kit/rn-changelog-generator').default;
const {danger, fail, /*message,*/ warn} = require('danger');
const includes = require('lodash.includes');

Expand Down Expand Up @@ -60,7 +57,9 @@ if (!includesTestPlan && !isFromPhabricator) {

// Check if there is a changelog and validate it
if (!isFromPhabricator) {
const status = validateChangelog(danger.github.pr.body);
const status = require('@rnx-kit/rn-changelog-generator').default.validate(
danger.github.pr.body,
);
const changelogInstructions =
'See <a target="_blank" href="https://reactnative.dev/contributing/changelogs-in-pull-requests">Changelog format</a>';
if (status === 'missing') {
Expand Down

0 comments on commit 94fdc38

Please sign in to comment.