name: Danger
-run-name: Updating labels for current PR
-
on:
pull_request_target:
types: [opened, synchronize]
env:
DANGER_GITHUB_BEARER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
- bundle exec danger --verbose --base=${{ github.event.pull_request.base.sha }} --head=${{ github.event.pull_request.head.sha }}
+ bundle exec danger --verbose
# Report if number of changed lines is > 500
if git.lines_of_code > 500
warn("Number of updated lines of code is too large to be in one PR. Perhaps it should be separated into two or more?")
- auto_label.set(pr_number, "Big PR", "FBCA04")
+ auto_label.set(pr_number, "big-pr", "FBCA04")
else
- auto_label.remove("Big PR")
+ auto_label.remove("big-pr")
end
# Get list of translation files (except en.yml) which are modified
# Report if some translation file (except en.yml) is modified
if modified_yml_files.empty?
- auto_label.remove("Inappropriate Translations")
+ auto_label.remove("inappropriate-translations")
else
modified_files_str = modified_yml_files.map { |file| "`#{file}`" }.join(", ")
warn("The following YAML files other than `en.yml` have been modified: #{modified_files_str}. Only `en.yml` is allowed to be changed. Translations are updated via Translatewiki, see CONTRIBUTING.md.")
- auto_label.set(pr_number, "Inappropriate Translations", "B60205")
+ auto_label.set(pr_number, "inappropriate-translations", "B60205")
end
# Report if there are merge-commits in PR
if git.commits.any? { |c| c.parents.count > 1 }
warn("Merge commits are found in PR. Please rebase to get rid of the merge commits in this PR, see CONTRIBUTING.md.")
- auto_label.set(pr_number, "Merge Commits", "D93F0B")
+ auto_label.set(pr_number, "merge-commits", "D93F0B")
else
- auto_label.remove("Merge Commits")
+ auto_label.remove("merge-commits")
end
+GIT
+ remote: https://github.com/tomhughes/danger.git
+ revision: a265cf74d2f464a25796b48d95697f5eed553454
+ ref: pull-request-target
+ specs:
+ danger (9.5.1)
+ base64 (~> 0.2)
+ claide (~> 1.0)
+ claide-plugins (>= 0.9.2)
+ colored2 (~> 3.1)
+ cork (~> 0.1)
+ faraday (>= 0.9.0, < 3.0)
+ faraday-http-cache (~> 2.0)
+ git (~> 1.13)
+ kramdown (~> 2.3)
+ kramdown-parser-gfm (~> 1.0)
+ octokit (>= 4.0)
+ pstore (~> 0.1)
+ terminal-table (>= 1, < 4)
+
GEM
remote: https://rubygems.org/
specs:
rexml
crass (1.0.6)
dalli (3.2.8)
- danger (9.5.1)
- base64 (~> 0.2)
- claide (~> 1.0)
- claide-plugins (>= 0.9.2)
- colored2 (~> 3.1)
- cork (~> 0.1)
- faraday (>= 0.9.0, < 3.0)
- faraday-http-cache (~> 2.0)
- git (~> 1.13)
- kramdown (~> 2.3)
- kramdown-parser-gfm (~> 1.0)
- octokit (>= 4.0)
- pstore (~> 0.1)
- terminal-table (>= 1, < 4)
danger-auto_label (1.3.1)
danger-plugin-api (~> 1.0)
danger-plugin-api (1.0.0)
config
connection_pool
dalli
- danger
+ danger!
danger-auto_label
dartsass-sprockets
debug