From ed9e2519040f3df0bb912d6e0065e6d62adcdca1 Mon Sep 17 00:00:00 2001 From: Ian Maia Date: Mon, 18 Dec 2023 18:35:06 +0100 Subject: [PATCH] Test with Danger on GHA --- .buildkite/pipeline.yml | 16 ---------------- .github/workflows/dangermattic.yml | 28 +++++++++++++++++----------- 2 files changed, 17 insertions(+), 27 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 5f6c233c109b..1e0c0860c48e 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -21,22 +21,6 @@ steps: # Wait for Gradle Wrapper to be validated before running any other jobs - wait - - label: "☢️ Danger - PR Check" - key: "danger" - 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" - agents: - queue: "default" - retry: - manual: - permit_on_passed: true - - label: "detekt" command: | echo "--- 🧹 Linting" diff --git a/.github/workflows/dangermattic.yml b/.github/workflows/dangermattic.yml index 7917d40fbfc1..74d97c954664 100644 --- a/.github/workflows/dangermattic.yml +++ b/.github/workflows/dangermattic.yml @@ -1,17 +1,23 @@ -name: ☢️ Trigger Danger Rerun +name: ☢️ Danger on GHA on: pull_request: - types: [edited, review_requested, review_request_removed, labeled, unlabeled, milestoned, demilestoned] + types: [opened, edited, review_requested, review_request_removed, labeled, unlabeled, milestoned, demilestoned, synchronize] jobs: dangermattic: - if: github.event.number > 0 - uses: Automattic/dangermattic/.github/workflows/reusable-retry-buildkite-step-on-events.yml@iangmaia/gha-triggering-danger - with: - org-slug: "automattic" - pipeline-slug: "woocommerce-android" - retry-step-key: "danger" - commit-sha: "${{ github.event.pull_request.head.sha }}" - secrets: - buildkite-api-token: ${{ secrets.TRIGGER_BK_BUILD_TOKEN }} + runs-on: ubuntu-latest + env: + DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - name: "📥 Checkout Repo" + uses: actions/checkout@v4 + - name: "💎 Ruby Setup" + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + - name: "☢️ Danger on GHA" + run: | + echo "--- 🏃 Running Danger: PR Check" + bundle exec danger --fail-on-errors=true --remove-previous-comments --danger_id=pr-check +