Skip to content
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

Skip changelog enforcement for bot PRs #979

Merged
merged 10 commits into from
Jul 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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