From ce2be4f76155dfece3347b45625351f51aa9bb5f Mon Sep 17 00:00:00 2001 From: Ishank Arora Date: Thu, 16 Jul 2020 15:52:20 +0200 Subject: [PATCH] Skip changelog enforcement for bot PRs (#979) --- .drone.yml | 2 +- .github/config.yml | 1 + .github/dependabot.yml | 2 ++ Makefile | 2 +- changelog/unreleased/changelog-skip-bots.md | 3 +++ tools/check-changelog/main.go | 8 ++++++++ 6 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 changelog/unreleased/changelog-skip-bots.md diff --git a/.drone.yml b/.drone.yml index d38370f155..5332ca2ec5 100644 --- a/.drone.yml +++ b/.drone.yml @@ -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 diff --git a/.github/config.yml b/.github/config.yml index f324da9d77..06682f674f 100644 --- a/.github/config.yml +++ b/.github/config.yml @@ -8,6 +8,7 @@ updateDocsWhiteList: - Tests-only - tests-only - Tests-Only + - Build-deps updateDocsTargetFiles: - changelog/unreleased/ diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 881d60d277..c229bac37e 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,6 +4,8 @@ updates: directory: "/" schedule: interval: daily + commit-message: + prefix: "[Build-deps]" open-pull-requests-limit: 10 reviewers: - ishank011 diff --git a/Makefile b/Makefile index 653b64f161..a3f89e7cb3 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/changelog/unreleased/changelog-skip-bots.md b/changelog/unreleased/changelog-skip-bots.md new file mode 100644 index 0000000000..f3452abc92 --- /dev/null +++ b/changelog/unreleased/changelog-skip-bots.md @@ -0,0 +1,3 @@ +Enhancement: Skip changelog enforcement for bot PRs. + +https://github.com/cs3org/reva/pull/979 diff --git a/tools/check-changelog/main.go b/tools/check-changelog/main.go index 55f86e6f06..33c55392b7 100644 --- a/tools/check-changelog/main.go +++ b/tools/check-changelog/main.go @@ -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"