Skip to content

Commit

Permalink
Skip changelog enforcement for bot PRs (#979)
Browse files Browse the repository at this point in the history
  • Loading branch information
ishank011 authored Jul 16, 2020
1 parent e7ab5b6 commit ce2be4f
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ steps:
- name: changelog
image: golang:1.13
commands:
- make check-changelog-drone
- make check-changelog-drone PR_CREATOR="$(git show -s --format='%cN' $DRONE_COMMIT)"

- name: license-check
image: golang:1.13
Expand Down
1 change: 1 addition & 0 deletions .github/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ updateDocsWhiteList:
- Tests-only
- tests-only
- Tests-Only
- Build-deps

updateDocsTargetFiles:
- changelog/unreleased/
2 changes: 2 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ updates:
directory: "/"
schedule:
interval: daily
commit-message:
prefix: "[Build-deps]"
open-pull-requests-limit: 10
reviewers:
- ishank011
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ check-changelog:
go run tools/check-changelog/main.go

check-changelog-drone:
go run tools/check-changelog/main.go -repo origin
go run tools/check-changelog/main.go -repo origin -user "$(PR_CREATOR)"

# to be run in CI platform
ci: build-ci test lint-ci
Expand Down
3 changes: 3 additions & 0 deletions changelog/unreleased/changelog-skip-bots.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Enhancement: Skip changelog enforcement for bot PRs.

https://github.com/cs3org/reva/pull/979
8 changes: 8 additions & 0 deletions tools/check-changelog/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,16 @@ import (

func main() {
repo := flag.String("repo", "", "the remote repo against which diff-index is to be derived")
user := flag.String("user", "", "the user who created the PR")
flag.Parse()

log.Print("PR created by: " + *user)
// Skip changelog check for PRs created by bots
if *user == "dependabot[bot]" {
log.Print("Skipping changelog check")
return
}

branch := "master"
if *repo != "" {
branch = *repo + "/master"
Expand Down

0 comments on commit ce2be4f

Please sign in to comment.