refactor(recipients-selection): move files and update scripts (#607) #64
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: execute-draw | |
on: | |
push: | |
branches: [main] | |
permissions: | |
contents: write | |
env: | |
BOT_NAME: "drawbot" | |
BOT_EMAIL: "drawbot@noemail.com" | |
jobs: | |
execute_draw: | |
if: "!contains(github.event.head_commit.author, 'drawbot')" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout 🛎️ | |
uses: actions/checkout@v3 | |
- name: Install nodejs 🔧 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: latest | |
- name: Install dchoose 🔧 | |
run: npm install -g dchoose | |
- name: Make folders if necessary 📁 | |
run: | | |
mkdir -p ./recipients_selection/draws | |
mkdir -p ./recipients_selection/lists | |
- name: Draw 🎲 | |
working-directory: recipients_selection | |
run: ./draw.sh | |
- name: Commit 🔐 | |
run: | | |
git config --global user.name $BOT_NAME | |
git config --global user.email $BOT_EMAIL | |
git add . | |
git commit -m "completed a recipient draw" | |
- name: Raise PR | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
branch: draw/results | |
branch-suffix: timestamp |