Skip to content

chore(ci): replace Danger with GitHub Actions native PR checks and SARIF - #1315

Merged
mikepenz merged 4 commits into
developfrom
chore/replace-danger-with-gh-actions
Apr 6, 2026
Merged

mikepenz merged 4 commits into
developfrom
chore/replace-danger-with-gh-actions

Conversation

@mikepenz

@mikepenz mikepenz commented Apr 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • Removes the Ruby/Bundler/Danger CI dependency entirely
  • Replaces danger-android_lint inline comments with github/codeql-action/upload-sarif@v4, uploading SARIF reports from all Android modules
  • Replaces Dangerfile PR quality gates (WIP, DO NOT MERGE, big PR) with a lightweight actions/github-script@v8 step in a new pr-checks.yml workflow
  • Adds explicit permissions blocks (contents: read, security-events: write on build job; pull-requests: read on pr-checks.yml)
  • Deletes Dangerfile, Gemfile, Gemfile.lock

Mirrors changes from mikepenz/multiplatform-markdown-renderer#522.

Note: Requires lint { sarifReport = true } in the convention plugin config (managed in the mikepenz/convention repo).

Test plan

  • Verify lint SARIF reports are generated at **/build/reports/lint-results-debug.sarif
  • Confirm SARIF annotations appear on PR diffs after merge
  • Confirm pr-checks.yml quality gates fire correctly for WIP/DO NOT MERGE labels

- Remove Ruby/Bundler/Danger dependency from CI entirely
- Replace danger-android_lint inline comments with github/codeql-action/upload-sarif
  using a collect step that gathers all lint-results-debug.sarif files
- Replace Dangerfile PR quality gates with lightweight actions/github-script step in pr-checks.yml
- Add contents: read and security-events: write permissions to build job
- Add pull-requests: read permission to pr-checks.yml
- Fix double-space whitespace in event_name conditions
- Delete Dangerfile, Gemfile, Gemfile.lock
Copilot AI review requested due to automatic review settings April 6, 2026 13:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the repo’s Ruby/Danger-based PR checks and replaces them with GitHub Actions-native checks, including uploading Android Lint results via SARIF and implementing lightweight PR “quality gates” in a dedicated workflow.

Changes:

  • Removed Danger/Bundler configuration (Dangerfile, Gemfile, Gemfile.lock) and the CI steps that executed Danger.
  • Added a new pr-checks.yml workflow that enforces WIP / DO NOT MERGE / big-PR gates using actions/github-script.
  • Updated CI to collect Android Lint SARIF reports across modules and upload them via github/codeql-action/upload-sarif.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
settings.gradle.kts Bumps the shared version catalog dependency version.
Gemfile.lock Removes Ruby dependency lockfile as Danger is removed.
Gemfile Removes Ruby gem dependencies for Danger plugins.
Dangerfile Removes legacy Danger-based PR gates and inline lint/detekt reporting.
.github/workflows/pr-checks.yml Adds PR quality gates via GitHub Script.
.github/workflows/ci.yml Uploads Android Lint SARIF reports and adds required job permissions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/ci.yml Outdated
Comment on lines +171 to +185
- name: Collect Lint SARIF reports
if: github.event_name == 'pull_request'
run: |
gem install danger
bundle exec danger --dangerfile=Dangerfile --danger_id=danger-pr
env:
DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
mkdir -p sarif-reports
find . -name "lint-results-debug.sarif" | while read f; do
module=$(echo "$f" | sed 's|^\./||' | sed 's|/build/reports/.*||' | sed 's|/|-|g')
cp "$f" "sarif-reports/${module}-lint.sarif"
done

- name: Upload Lint SARIF
if: always() && github.event_name == 'pull_request'
uses: github/codeql-action/upload-sarif@v4
with:
sarif_file: 'sarif-reports'
category: android-lint

Copilot AI Apr 6, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The SARIF upload step will run even when no lint-results-debug.sarif files were generated (e.g., if SARIF output isn’t enabled or lint fails early). In that case upload-sarif is likely to fail and obscure the original lint failure. Consider gating the upload on at least one collected SARIF file (or making the collection step emit a boolean output and using it in the if:).

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/ci.yml Outdated
env:
DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
mkdir -p sarif-reports
find . -name "lint-results-debug.sarif" | while read f; do

Copilot AI Apr 6, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

find ... | while read f; do will mis-handle paths containing backslashes or leading/trailing whitespace, and can mangle filenames with spaces. Use while IFS= read -r f; do (and ideally find ... -print0 with a NUL-safe loop) to make the collection robust.

Suggested change
find . -name "lint-results-debug.sarif" | while read f; do
find . -name "lint-results-debug.sarif" -print0 | while IFS= read -r -d '' f; do

Copilot uses AI. Check for mistakes.
@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@mikepenz
mikepenz merged commit ee80e14 into develop Apr 6, 2026
4 checks passed
@mikepenz
mikepenz deleted the chore/replace-danger-with-gh-actions branch April 6, 2026 15:00
@mikepenz mikepenz added the other label Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants