Skip to content

Commit

Permalink
rultor: Check maintainership before merging
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
adtac committed Jul 31, 2017
1 parent b26015a commit 17797c6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
13 changes: 13 additions & 0 deletions .ci/check_maintainership.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

# Do not use `set -x` here as then it displays the PYPIPW in logs
set -e

# Get environment variables, readily decrypted by rultor
source ../rultor_secrets.sh

# Make sure the user is a maintainer
if curl "https://api.github.com/teams/1238757/memberships/${author}?access_token=${GITHUB_TOKEN}" | grep -q "Not Found"; then
echo "@${author} is not in the maintainers group."
exit 1
fi
6 changes: 5 additions & 1 deletion .rultor.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
merge:
fast-forward: only
script: echo "Nothing to do."
script:
- bash .ci/check_maintainership.sh

decrypt:
rultor_secrets.sh: "repo/.ci/rultor_secrets.sh.asc"

0 comments on commit 17797c6

Please sign in to comment.