Skip to content

Commit 17797c6

Browse files
committed
rultor: Check maintainership before merging
This adds 1 environment variable: export GITHUB_TOKEN=... Currently @adtac's Github token is used. Please note that the used token must have admin rights to the coala organization.
1 parent b26015a commit 17797c6

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

.ci/check_maintainership.sh

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
# Do not use `set -x` here as then it displays the PYPIPW in logs
4+
set -e
5+
6+
# Get environment variables, readily decrypted by rultor
7+
source ../rultor_secrets.sh
8+
9+
# Make sure the user is a maintainer
10+
if curl "https://api.github.com/teams/1238757/memberships/${author}?access_token=${GITHUB_TOKEN}" | grep -q "Not Found"; then
11+
echo "@${author} is not in the maintainers group."
12+
exit 1
13+
fi

.rultor.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
merge:
22
fast-forward: only
3-
script: echo "Nothing to do."
3+
script:
4+
- bash .ci/check_maintainership.sh
5+
6+
decrypt:
7+
rultor_secrets.sh: "repo/.ci/rultor_secrets.sh.asc"

0 commit comments

Comments
 (0)