generated from marcizhu/readme-chess
-
Notifications
You must be signed in to change notification settings - Fork 20
56 lines (48 loc) · 1.6 KB
/
Chess.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Chess
on:
issues:
types: [opened]
jobs:
move:
name: Play Chess
runs-on: ubuntu-latest
if: startsWith(github.event.issue.title, 'Chess:')
steps:
- uses: actions/checkout@v3
# Set up a Python 3.10 (64-bit) instance
- name: Setting up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
architecture: "x64"
# Use pip to install the dependencies and then run the script
- name: Play chess
env:
ISSUE_NUMBER: ${{ github.event.issue.number }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPOSITORY_OWNER: ${{ github.repository_owner }}
run: |
pip install -r requirements.txt
python main.py
# Create new commit with the changed files and push it to GitHub
- name: Commit and push changes
env:
ISSUE_TITLE: ${{ github.event.issue.title }}
ISSUE_AUTHOR: ${{ github.event.issue.user.login }}
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "${ISSUE_TITLE} by ${ISSUE_AUTHOR}"
git push
- name: Install stockfish
run: |
sudo apt-get update
sudo apt-get install -y stockfish
echo STOCKFISH_PATH="$(which stockfish)" >> $GITHUB_ENV
- name: Run webhook
env:
WEBHOOK_URL: ${{ secrets.WEBHOOK_URL }}
run: |
pip install -r requirements-webhook.txt
python webhook.py