Skip to content

Commit

Permalink
Add dangermattic GHA triggering danger Buildkite pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
iangmaia committed Nov 30, 2023
1 parent a26f9f4 commit 45a3f65
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 12 deletions.
21 changes: 21 additions & 0 deletions .buildkite/danger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Nodes with values to reuse in the pipeline.
common_params:
# Common plugin settings to use with the `plugins` key.
- &ruby_image "public.ecr.aws/docker/library/ruby:3.2.2"

agents:
queue: "main"

steps:
- label: "☢️ Danger - PR Check"
command: .buildkite/commands/danger-pr-check.sh
plugins:
- docker#v5.8.0:
image: *ruby_image
propagate-environment: true
environment:
- "DANGER_GITHUB_API_TOKEN"
if: "build.pull_request.id != null"
retry:
manual:
permit_on_passed: true
22 changes: 10 additions & 12 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,16 @@ steps:
# Wait for Gradle Wrapper to be validated before running any other jobs
- wait

- label: "☢️ Danger - PR Check"
command: .buildkite/commands/danger-pr-check.sh
plugins:
- docker#v5.8.0:
image: "public.ecr.aws/docker/library/ruby:3.2.2"
propagate-environment: true
environment:
- "DANGER_GITHUB_API_TOKEN"
if: "build.pull_request.id != null"
retry:
manual:
permit_on_passed: true
- trigger: "danger"
label: "☢️ Danger - PR Check"
build:
message: "${BUILDKITE_MESSAGE}"
commit: "${BUILDKITE_COMMIT}"
branch: "${BUILDKITE_BRANCH}"
env:
BUILDKITE_PULL_REQUEST: "${BUILDKITE_PULL_REQUEST}"
BUILDKITE_PULL_REQUEST_BASE_BRANCH: "${BUILDKITE_PULL_REQUEST_BASE_BRANCH}"
BUILDKITE_PULL_REQUEST_REPO: "${BUILDKITE_PULL_REQUEST_REPO}"

- label: "detekt"
command: |
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/dangermattic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
on:
pull_request:
types: [review_requested, review_request_removed, labeled, unlabeled, milestoned, demilestoned]

steps:
- name: "☢️ Danger - PR Check"
uses: "buildkite/trigger-pipeline-action@v2.0.0"
with:
buildkite_api_access_token: ${{ secrets.TRIGGER_BK_BUILD_TOKEN }}
pipeline: "automattic/woocommerce-android"
branch: "${{ github.head_ref }}"
build_env_vars: '{"PIPELINE": "danger.yml", "BUILDKITE_PULL_REQUEST": "${{ github.event.issue.number }}", "BUILDKITE_PULL_REQUEST_REPO": "${{ github.repository }}", "BUILDKITE_PULL_REQUEST_BASE_BRANCH": "${{ github.ref }}"}'

0 comments on commit 45a3f65

Please sign in to comment.