Add support for running changelog checks without GitHub API token#65
Merged
dblock merged 3 commits intodblock:masterfrom Dec 9, 2025
Merged
Add support for running changelog checks without GitHub API token#65dblock merged 3 commits intodblock:masterfrom
dblock merged 3 commits intodblock:masterfrom
Conversation
Introduce PRMetadata class to extract PR information from multiple sources: - GITHUB_EVENT_PATH (GitHub Actions, no token required) - GitHub plugin (traditional Danger with token) - Fallback example data (local/dry_run) This allows running `danger dry_run` in GitHub Actions workflows without requiring GITHUB_TOKEN for changelog validation.
Owner
|
👏 I'm going to add you to the gem owners so you can increment the version, make releases. |
numbata
added a commit
to numbata/danger-changelog
that referenced
this pull request
Dec 9, 2025
Use 'danger dry_run' which doesn't require GitHub API authentication. In dry_run mode, the github plugin is unavailable (returns nil), allowing the danger-changelog plugin to use GITHUB_EVENT_PATH for PR metadata. This achieves the goal of PR dblock#65 (github-tokenless-fallback) - running changelog checks without needing any API token or external authentication. The graceful error handling in PRMetadata.from_github_plugin ensures the fallback chain works correctly when github plugin is unavailable.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PRMetadataclass to extract PR information from multiple sources:GITHUB_EVENT_PATH(GitHub Actions), thegithubDanger plugin, or fallback example valuesdanger dry_runin GitHub Actions without requiringGITHUB_TOKENorDANGER_GITHUB_API_TOKENMotivation
When running
bundle exec danger dry_run --base=$BASE_SHA --head=$HEAD_SHAin GitHub Actions, thegithubplugin is unavailable (usesLocalOnlyrequest source). Previously, this caused errors when generating changelog entry examples.Now the plugin reads PR metadata from
GITHUB_EVENT_PATHfirst (always available in GitHub Actions without token), then falls back to the github plugin, and finally uses example placeholder values.This is a part of preparation for ruby-grape/grape#2630 as a part of ruby-grape/grape#2632