-
-
Notifications
You must be signed in to change notification settings - Fork 8
Feat: Allow repo specific dangerfile. #129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
aac9829
branch cleanup
lucas-zimerman a2e8261
Merge branch 'main' into lz/ext-danger
lucas-zimerman 7e4598b
Update danger/action.yml
lucas-zimerman c4c0849
Update danger/action.yml
lucas-zimerman bb559db
Update danger/action.yml
lucas-zimerman e765013
reviewed changes
lucas-zimerman ccf73eb
fix customPath ref
lucas-zimerman 8c62a42
load path
lucas-zimerman 2cc1eb3
code ref fix / simplified transversal check
lucas-zimerman 283729d
use env
lucas-zimerman 5cbc268
Apply suggestions from code review
lucas-zimerman 5cdeef3
applied suggestion
lucas-zimerman 49e1cb3
missing dangerfile input definition
lucas-zimerman f2dfd1a
fix empty EXTRA_DANGERFILE_INPUT
lucas-zimerman 0a9ab78
fix env name
lucas-zimerman 3b57951
applied code suggestions
lucas-zimerman 5a3a11d
Apply suggestion from @vaind
vaind 5be5614
Apply suggestion from @vaind
vaind 240ed21
chore: minor refactoring
vaind 35ba335
test(danger): Add comprehensive tests for extra-dangerfile and extra-…
vaind File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| // Test dangerfile for exercising extra-dangerfile feature | ||
| // This demonstrates how repositories can add custom Danger checks | ||
|
|
||
| module.exports = async function ({ fail, warn, message, markdown, danger }) { | ||
| console.log('::notice::Running custom dangerfile checks...'); | ||
|
|
||
| // Test that we have access to the danger API | ||
| if (!danger || !danger.github || !danger.github.pr) { | ||
| fail('Custom dangerfile cannot access danger API'); | ||
| return; | ||
| } | ||
|
|
||
| // Example check: Verify PR has a description | ||
| const prBody = danger.github.pr.body; | ||
| if (!prBody || prBody.trim().length === 0) { | ||
| warn('PR description is empty. Consider adding a description to help reviewers.'); | ||
| } else { | ||
| message('✅ Custom dangerfile check: PR has a description'); | ||
| } | ||
|
|
||
| // Example check: Verify PR title is not too short | ||
| const prTitle = danger.github.pr.title; | ||
| if (prTitle && prTitle.length < 10) { | ||
| warn('PR title is quite short. Consider making it more descriptive.'); | ||
| } else { | ||
| message('✅ Custom dangerfile check: PR title length is reasonable'); | ||
| } | ||
|
|
||
| // Show that we can access git information | ||
| const modifiedFiles = danger.git.modified_files || []; | ||
| const createdFiles = danger.git.created_files || []; | ||
| const totalChangedFiles = modifiedFiles.length + createdFiles.length; | ||
|
|
||
| message(`📊 Custom check: This PR changes ${totalChangedFiles} file(s)`); | ||
|
|
||
| console.log('::notice::Custom dangerfile checks completed successfully'); | ||
| }; |
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.