Skip to content

Commit d80a08b

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 e34c274 commit d80a08b

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
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

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

0 commit comments

Comments
 (0)