Skip to content

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

Merged
mikepenz merged 3 commits intodevelopfrom
chore/replace-danger-with-sarif
Apr 6, 2026
Merged

chore(ci): replace Danger with GitHub Actions native PR checks and SARIF#522
mikepenz merged 3 commits intodevelopfrom
chore/replace-danger-with-sarif

Conversation

@mikepenz
Copy link
Copy Markdown
Owner

@mikepenz mikepenz commented Apr 6, 2026

Summary

  • Removes Ruby/Bundler/Danger dependency from CI entirely
  • Replaces danger-android_lint inline comments with github/codeql-action/upload-sarif, uploading SARIF reports from all Android modules (**/build/reports/lint-results-debug.sarif)
  • Replaces Dangerfile PR quality gates (WIP, DO NOT MERGE, big PR) with a lightweight actions/github-script step in a dedicated pr-checks.yml workflow running on ubuntu-latest with default permissions
  • build job in ci.yml now only holds security-events: write (needed for SARIF upload) — no pull-requests: write required

Notes

  • SARIF lint results appear as inline annotations on PR diffs in the "Files changed" tab and in the Security → Code Scanning tab
  • The convention plugin (AndroidApplicationConventionPlugin + AndroidLibraryConventionPlugin) must have lint { sarifReport = true } enabled (done separately in the convention repo)

🤖 Generated with Claude Code

Remove Ruby/Danger setup and replace with lightweight GitHub Actions alternatives:

- Add `.github/workflows/pr-checks.yml` for PR quality gates (WIP label,
  DO NOT MERGE label, big PR warning) via `actions/github-script` on a
  minimal ubuntu runner with default permissions
- Replace `Setup Ruby` + `Run Danger` steps in `ci.yml` with
  `github/codeql-action/upload-sarif` to report Android lint results from
  all modules as inline PR annotations via GitHub Code Scanning
- Scope `security-events: write` permission to the build job only (no
  longer needs `pull-requests: write`)
- Delete `Dangerfile`, `Gemfile`, `Gemfile.lock`

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 6, 2026 12:12
@mikepenz mikepenz added the other label Apr 6, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 Ruby/Danger-based PR automation from CI and replaces it with GitHub Actions-native PR quality gates plus SARIF upload for Android lint results.

Changes:

  • Remove Dangerfile, Gemfile, and Gemfile.lock (dropping Ruby/Bundler/Danger from CI).
  • Add a new pr-checks.yml workflow using actions/github-script for PR quality gates (WIP / DO NOT MERGE / big PR).
  • Update ci.yml to upload Android lint SARIF results via github/codeql-action/upload-sarif.

Reviewed changes

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

Show a summary per file
File Description
Gemfile.lock Removes Danger/Bundler dependency lockfile from the repo.
Gemfile Removes Ruby gem dependencies used only for Danger.
Dangerfile Deletes the legacy Danger-based PR checks and Android lint inline comments.
.github/workflows/pr-checks.yml Adds GitHub Actions-native PR quality gates using actions/github-script.
.github/workflows/ci.yml Replaces Danger execution with SARIF upload for Android lint; adjusts job permissions.

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

Comment thread .github/workflows/ci.yml
Comment on lines +65 to 69
permissions:
security-events: write
steps:
- name: Checkout
uses: actions/checkout@v6
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

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

permissions is set at the job level but only grants security-events: write. In GitHub Actions, specifying permissions overrides defaults, so contents: read is no longer granted and actions/checkout (and other steps that read the repo) can fail with a 403. Add contents: read (and any other required scopes) alongside security-events: write.

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/ci.yml
Comment thread .github/workflows/pr-checks.yml
- actions/github-script v7 -> v8
- github/codeql-action/upload-sarif v3 -> v4

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@mikepenz mikepenz force-pushed the chore/replace-danger-with-sarif branch from 1ae3c29 to 832a03b Compare April 6, 2026 12:22
- Collect all lint-results-debug.sarif files from all modules into a
  single sarif-reports/ directory with unique names before uploading
- Switch upload-sarif action from unsupported glob to directory path
- Add if: always() to Archive Test Report step so it runs on failure
- Add contents: read permission to build job

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@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 88995a5 into develop Apr 6, 2026
4 checks passed
@mikepenz mikepenz deleted the chore/replace-danger-with-sarif branch April 6, 2026 12:58
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