diff --git a/.circleci/config.yml b/.circleci/config.yml
index afeeb6fee35..3c3c3fce637 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -327,13 +327,6 @@ jobs:
command: GITHUB_TOKEN="$PUBLIC_ANALYSISBOT_GITHUB_TOKEN_A""$PUBLIC_ANALYSISBOT_GITHUB_TOKEN_B" yarn lint-ci
when: always
- - run:
- name: Analyze Pull Request (pull-bot)
- command: |
- cd bots
- DANGER_GITHUB_API_TOKEN="$PUBLIC_PULLBOT_GITHUB_TOKEN_A""$PUBLIC_PULLBOT_GITHUB_TOKEN_B" yarn danger ci --use-github-checks
- when: always
-
# -------------------------
# JOBS: Analyze Code
# -------------------------
@@ -1315,11 +1308,8 @@ workflows:
# Run lints on every commit
- analyze_code
- # Run code checks on PRs from forks
- - analyze_pr:
- filters:
- branches:
- only: /^pull\/.*$/
+ # Run code checks on PRs
+ - analyze_pr
# Gather coverage
- js_coverage
diff --git a/.github/workflows/danger_pr.yml b/.github/workflows/danger_pr.yml
new file mode 100644
index 00000000000..8d93b77c410
--- /dev/null
+++ b/.github/workflows/danger_pr.yml
@@ -0,0 +1,18 @@
+name: Run Danger on PR
+
+on:
+ pull_request:
+ types: [opened, edited, reopened, synchronize]
+
+jobs:
+ danger:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - run: yarn install
+ working-directory: bots
+ - name: Danger
+ run: yarn danger ci --use-github-checks --failOnErrors --id danger_pr
+ working-directory: bots
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/bots/dangerfile.js b/bots/dangerfile.js
index 30545cbd078..40e28921179 100644
--- a/bots/dangerfile.js
+++ b/bots/dangerfile.js
@@ -29,7 +29,7 @@ if (!danger.github.pr.body || danger.github.pr.body.length < 50) {
'Can you add a Summary? ' +
'To do so, add a "## Summary" section to your PR description. ' +
'This is a good place to explain the motivation for making this change.';
- message(`${title} - ${idea}`);
+ warn(`${title} - ${idea}`);
}
// Warns if there are changes to package.json, and tags the team.
@@ -53,7 +53,7 @@ if (!includesTestPlan && !isFromPhabricator) {
'Can you add a Test Plan? ' +
'To do so, add a "## Test Plan" section to your PR description. ' +
'A Test Plan lets us know how these changes were tested.';
- message(`${title} - ${idea}`);
+ warn(`${title} - ${idea}`);
}
// Regex looks for given categories, types, a file/framework/component, and a message - broken into 4 capture groups
@@ -80,11 +80,11 @@ if (!includesChangelog) {
'Can you add a Changelog? ' +
'To do so, add a "## Changelog" section to your PR description. ' +
changelogInstructions;
- message(`${title} - ${idea}`);
+ fail(`${title} - ${idea}`);
} else if (!correctlyFormattedChangelog && !containsInternalChangelog) {
const title = ':clipboard: Verify Changelog Format';
const idea = changelogInstructions;
- message(`${title} - ${idea}`);
+ fail(`${title} - ${idea}`);
}
// Warns if the PR is opened against stable, as commits need to be cherry picked and tagged by a release maintainer.