-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Tom Siewert <[email protected]>
- Loading branch information
1 parent
355c37e
commit 44f7461
Showing
3 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 @@ | ||
--- | ||
name: Dangerbot | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
danger: | ||
name: Danger | ||
runs-on: self-hosted | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Ruby 3.0 | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: '3.0' | ||
|
||
- name: Configure cache | ||
uses: actions/cache@v1 | ||
with: | ||
path: vendor/bundle | ||
key: ${{ runner.os }}-gems-${{ hashFiles('Gemfile') }} | ||
restore-keys: | | ||
${{ runner.os }}-gems- | ||
- name: Run Danger | ||
uses: MeilCli/danger-action@v5 | ||
with: | ||
plugins_file: 'Gemfile' | ||
install_path: 'vendor/bundle' | ||
danger_file: 'Dangerfile' | ||
danger_id: 'danger-pr' | ||
env: | ||
DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains 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,12 @@ | ||
# -*- mode: ruby -*- vim: set syntax=ruby | ||
# frozen_string_literal: true | ||
|
||
if git.commits.any? { |c| c.message =~ /^Merge branch/ } | ||
fail('Please rebase to get rid of the merge commits in this PR!') | ||
message "For more information, please see [man git-rebase](https://git-scm.com/docs/git-rebase)." | ||
end | ||
|
||
if !git.modified_files.include?("CHANGELOG.md") && !has_app_changes | ||
fail("Please include a CHANGELOG entry. \nYou can find it at [CHANGELOG.md](https://github.com/hetznercloud/ansible-ipxe-ca/blob/main/CHANGELOG.md).") | ||
message "Note, we use [changelogger](https://github.com/MarkusFreitag/changelogger) as changelog tooling." | ||
end |
This file contains 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,5 @@ | ||
# frozen_string_literal: true | ||
|
||
source 'https://rubygems.org' | ||
|
||
gem 'danger' |