-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7985ba9
commit e2b689d
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Tic-Tac-Toe Game | ||
|
||
on: | ||
issues: | ||
types: [opened] | ||
|
||
jobs: | ||
process_move: | ||
runs-on: ubuntu-latest | ||
if: startsWith(github.event.issue.title, 'move') | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Process move | ||
run: | | ||
move=$(echo ${{ github.event.issue.title }} | sed 's/move //') | ||
python tic_tac_toe.py $move | ||
- name: Commit and push if changed | ||
run: | | ||
git config --global user.name 'GitHub Action' | ||
git config --global user.email '[email protected]' | ||
git add README.md | ||
git diff --quiet && git diff --staged --quiet || (git commit -m "Update game board"; git push) | ||
- name: Close issue | ||
uses: peter-evans/close-issue@v2 | ||
with: | ||
issue-number: ${{ github.event.issue.number }} | ||
comment: "Move processed. Check the README for the updated game board." |