From 7b73a20800fd8aa2174fdffeda395fab57333652 Mon Sep 17 00:00:00 2001 From: Lucas Menendez Date: Thu, 16 Nov 2023 10:13:08 +0100 Subject: [PATCH] ensure that ony the user defined as assignee on ceremnoy PR can finish it, new art for contribute script --- .github/workflows/finish-ceremony.yml | 2 +- scripts/contribute | 53 +++++++++++++++++++++++++-- 2 files changed, 51 insertions(+), 4 deletions(-) diff --git a/.github/workflows/finish-ceremony.yml b/.github/workflows/finish-ceremony.yml index 8a71711..6a6b20e 100644 --- a/.github/workflows/finish-ceremony.yml +++ b/.github/workflows/finish-ceremony.yml @@ -4,7 +4,7 @@ on: types: [ closed ] jobs: finish-ceremony: - if: ${{ github.event.pull_request.merged == false && github.actor == github.event.pull_request.user.login && contains(github.event.pull_request.labels.*.name, 'on-going-ceremony') && startsWith(github.event.pull_request.head.ref, 'ceremony/') }} + if: ${{ github.event.pull_request.merged == false && github.actor == github.event.pull_request.assignee.login && contains(github.event.pull_request.labels.*.name, 'on-going-ceremony') && startsWith(github.event.pull_request.head.ref, 'ceremony/') }} runs-on: ubuntu-latest steps: - name: Checkout the repository diff --git a/scripts/contribute b/scripts/contribute index 95b4dc9..544e535 100755 --- a/scripts/contribute +++ b/scripts/contribute @@ -1,14 +1,60 @@ #!/bin/bash +intro_message() { + echo " -prompt_env_inputs() { - echo "Welcome to the zk-voceremony contribution process! - " + __ __ ______ ______ _______ ______ __ __ ______ + | \ | \ / \ / \ | \ / \ | \ | \| \ + | ## | ##| ######\| ######\| #######\| ######\| ##\ | ## \###### + | ## | ##| ## | ##| ## \##| ## | ##| ## | ##| ###\| ## | ## + \##\ / ##| ## | ##| ## | ## | ##| ## | ##| ####\ ## | ## + \##\ ## | ## | ##| ## __ | ## | ##| ## | ##| ##\## ## | ## + \## ## | ##__/ ##| ##__/ \| ##__/ ##| ##__/ ##| ## \#### _| ##_ + \### \## ## \## ##| ## ## \## ##| ## \###| ## \ + \# \###### \###### \####### \###### \## \## \###### + + zk-SNARKs Anonymous Voting Trusted Setup Ceremony + + ,******,*,. + *********,,,,,,,,. + *//*********,,,,,, + //////**********,. + .,**///////////*******. + .*********(((////////////***,,,,,,. + .**************,*((((((((/////////*,,,,,,,,,,,,. + ,********/////////////////((((((((//////,,,,,,,,,,,,......... + (/***************///////////*******//(((((/*,,,,,,,,,,,..........., + (#(((((/*,***********/..***/************,,,*,,,,,,,,,.......,,,,,,, + ((##((((((((/*,,*********,,,,,,,,,,,,,,,,,,,,,,,,,...,******,***,,, + #(((((((((((((((((/*,,,,,,,,,,,,,,,,,,,,,,,,...,***********,,,,,,,, + #(((((((((((//((((((((///*,.,,,,,,,,,,...,***///**//*,,****,,,,,,,, + ##((((((((((((((((//(((((//////*,..,**/////////************,,,,,,,, + ##(((((((((((((((((((((///(((////*///////***/***************,,,,,,, + ####(((((((((((((((((((//////////*/**//////////****************,,,, + ######(((((((((((((((((/(////////*///////////////*****************, + (#######(((((((((((((((((////////*///////////////////*************, + (#########((((((((((((((((///////*//////////////////////**********, + /##########(((((((((((((((((/////*////////////////////////********. + /############(((((((((((((((((((/*/////////////////////////*******. + /%############((((((((((((((((((*//////////////////////////////. + *###########(((((((((((((((//(///((((((((//////////(/. + .########(((((((((((((/((((((((((((((((((((. + ./#####((((((((((/(((((((((((((((. + *####((((((/((((((((((. + .###((/(((((. + *. +" + echo + echo "Welcome to the zk-voceremony contribution process!" + echo echo "To start your contribution you need to provide the following information:" echo " - Login to your GitHub account (commits will use your github username)" echo " - The URL of the repository of the ceremony (by default 'https://github.com/vocdoni/zk-voceremony.git')" echo " - The name of the ceremony (used to name the ceremony branch)" +} + +prompt_env_inputs() { GITHUB_REPO_URL="https://github.com/vocdoni/zk-voceremony.git" read -p "Enter the url of the repo (by default 'https://github.com/vocdoni/zk-voceremony.git'): " REPO_URL if [ -n "$REPO_URL" ]; then @@ -125,6 +171,7 @@ publish_contribution() { } init_contribution() { + intro_message prompt_env_inputs check_contribute_env make_contribution || error "contribution failed"