Skip to content

Commit 26b294a

Browse files
authored
Update Danger setup to run via Buildkite + Add RuboCop linter (#627)
2 parents ffacf8a + fa5d404 commit 26b294a

File tree

2 files changed

+30
-6
lines changed

2 files changed

+30
-6
lines changed

.buildkite/pipeline.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,22 @@ steps:
6363
plugins: [*docker_plugin]
6464
agents:
6565
queue: "default"
66+
67+
- group: "Linters"
68+
steps:
69+
- label: ☢️ Danger - PR Check
70+
command: danger
71+
key: danger
72+
if: build.pull_request.id != null
73+
retry:
74+
manual:
75+
permit_on_passed: true
76+
agents:
77+
queue: linter
78+
79+
- label: ":rubocop: Rubocop"
80+
command: rubocop
81+
key: rubocop
82+
if: build.pull_request.id != null
83+
agents:
84+
queue: linter

.github/workflows/run-danger.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
1-
name: ☢️ Danger
1+
name: ☢️ Trigger Danger On Buildkite
22

33
on:
44
pull_request:
5-
types: [opened, reopened, ready_for_review, synchronize, edited, review_requested, review_request_removed, labeled, unlabeled, milestoned, demilestoned]
5+
types: [labeled, unlabeled, milestoned, demilestoned, ready_for_review, review_requested, review_request_removed]
66

77
jobs:
88
dangermattic:
9-
# runs on draft PRs only for opened / synchronize events
10-
if: ${{ (github.event.pull_request.draft == false) || (github.event.pull_request.draft == true && contains(fromJSON('["opened", "synchronize"]'), github.event.action)) }}
11-
uses: Automattic/dangermattic/.github/workflows/reusable-run-danger.yml@v1.0.0
9+
if: ${{ (github.event.pull_request.draft == false) }}
10+
uses: Automattic/dangermattic/.github/workflows/reusable-retry-buildkite-step-on-events.yml@v1
11+
with:
12+
org-slug: automattic
13+
pipeline-slug: release-toolkit
14+
retry-step-key: danger
15+
build-commit-sha: ${{ github.event.pull_request.head.sha }}
16+
cancel-running-github-jobs: false
1217
secrets:
13-
github-token: ${{ secrets.DANGERMATTIC_GITHUB_TOKEN }}
18+
buildkite-api-token: ${{ secrets.TRIGGER_BK_BUILD_TOKEN }}

0 commit comments

Comments
 (0)