chore: add auto-approve bot (#1320)
Adds an [auto approve configuration](https://github.com/googleapis/repo-automation-bots/blob/master/packages/auto-approve/README.md) to automatically approve the PRs that update discovery artifacts.
Only PRs that match these conditions will be approved:
- PR Author is `yoshi-code-bot`
- PR Title is `chore: Update discovery artifacts`
- Files changed limited to the following
`docs/dyn/index.md` , `docs/dyn/*.html"` or `googleapiclient/discovery_cache/documents/*.json`
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index 30c3973..b3f0cd0 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -8,4 +8,6 @@
* @googleapis/yoshi-python
# The python-samples-reviewers team is the default owner for samples changes
-/samples/ @googleapis/python-samples-owners
\ No newline at end of file
+/samples/ @googleapis/python-samples-owners
+
+.github/auto-approve.yml @googleapis/github-automation @googleapis/yoshi-python
diff --git a/.github/auto-approve.yml b/.github/auto-approve.yml
new file mode 100644
index 0000000..a84a36a
--- /dev/null
+++ b/.github/auto-approve.yml
@@ -0,0 +1,20 @@
+# https://github.com/googleapis/repo-automation-bots/tree/master/packages/auto-approve
+
+rules:
+
+# incoming PRs from yoshi-code-bot
+- author: "yoshi-code-bot"
+
+# Title for PRs from yoshi-code-bot MUST start with `chore: Update discovery artifacts`.
+# Title must be regex.
+ title: "^chore: Update discovery artifacts"
+
+# The only changed file paths in an incoming PR MUST be exactly
+# `"^docs/dyn/index.md$"` or follow either one of these patterns `"docs/dyn/*.html"`
+# or `"googleapiclient/discovery_cache/documents/*.json"` . These are
+# listed in regex. If this property is omitted, auto-approve bot will allow PRs
+# that match the author and title to merge, without checking the file paths.
+ changedFiles:
+ - "^docs/dyn/index.md$"
+ - "^docs/dyn/.*\\.html$"
+ - "^googleapiclient/discovery_cache/documents/.*\\.json$"